You are not logged in.

#1 2012-05-10 07:28:26

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Network bridge problems linking wwan0 and eth0 [SOLVED]

Hi There,

I have just got working a 3G modem which appears as device wwan0. I am trying to link this interface to my wired ethernet eth0.
wwan0 seems to work fine with network manager, getting a IP address via dhcp works just fine and I can use the interface.
However, when I disable network manager and try to bring up the bridge with "netcfg up bridge" it times out, failing to get an lease with dhcp.

My /etc/network.d/bridge file contains the following:

 
INTERFACE="br0"
CONNECTION="bridge"
DESCRIPTION="Bridge wired and wireless connection"

BRIDGE_INTERFACES="eth0 wwan0"
IP="dhcp"
#FWD_DELAY=10

As per the wiki, I have tried using various values for FWD_DELAY (i.e 10 7 5,4,3,2,1,0) but nothing ..

The relevant sections of /etc/rc.conf are:

NETWORKS=(bridge)
....
DAEMONS=( ... net-profiles !networkmanager ...)

It seems that DHCP via networkmanager is the only way the interface gets an IP. I even tried "dhcpd br0" or "dhcpd wwan0" and they both time out.

Anyone have any suggestions?

Last edited by bmentink (2012-05-15 22:02:00)

Offline

#2 2012-05-10 17:18:39

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

What you are trying to do is not supported in netcfg IMO. Why not stick to networkmanager (wiki and the links in see also there).

Offline

#3 2012-05-10 19:04:21

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Strike0 wrote:

What you are trying to do is not supported in netcfg IMO. Why not stick to networkmanager (wiki and the links in see also there).

What do you mean? netcfg supports starting bridge interfaces ... I am just doing the same as this wiki: https://wiki.archlinux.org/index.php/So … cess_Point
The only change is I am linking eth0 and wwan0 ..

How can I stick with Networkmanager, it doesn't support the creation of bridges as far as I know .. please show me how to create and dhcp a bridge with Networkmanager ..

Offline

#4 2012-05-11 18:03:57

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

bmentink wrote:

What do you mean? netcfg supports starting bridge interfaces ... I am just doing the same as this wiki: https://wiki.archlinux.org/index.php/So … cess_Point

No, as I read your wiki link  netcfg supported the way you tried it (i.e. without hostapd) before kernel 2.6.33. Or are you using an older kernel?

bmentink wrote:

The only change is I am linking eth0 and wwan0 ..

Yes, exactly - and netcfg does not support 3G interfaces. Please read the wiki links above - its all in there.
Further, there are plenty of threads here about it, try a search for "3G and hostapd".

Offline

#5 2012-05-13 09:02:11

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Sorry, still am at a loss of how to implement this, confused even more by all the different ways to share a connection.
None of the examples are doing what I want to achieve ..

On my wwan0 3G interface I want to use dhcp to get an external IP dished out my the network....
I then want to bridge that connection to my wired interface eth0 PASSING on that IP to a router ... i.e eth0 is connected to the wlan input on the router.
The router then uses it's dhcp server to dish up IP's to my internal network..

Can someone please hint as to the easiest way to achieve this ..

Thanks,
Bernie

Last edited by bmentink (2012-05-13 09:04:02)

Offline

#6 2012-05-13 10:16:19

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

bmentink wrote:

On my wwan0 3G interface I want to use dhcp to get an external IP dished out my the network....
I then want to bridge that connection to my wired interface eth0 PASSING on that IP to a router ... i.e eth0 is connected to the wlan input on the router.
The router then uses it's dhcp server to dish up IP's to my internal network..

Now you get me confused on what you want to do with that "eth0 is connected to the wlan input on the router".
In your first post you say you want to bridge the eth0 to wired.
I think you want to forward the wwan via eth0 to your routers' eth, which then share's the connection out via wlan with other devices.
What you do in your router to share the wired connection is one thing. The other one is using hostapd on your PC with the 3G device to forward that connection out via eth0 (i.e. what used to be bridge). That you do with the iptables forward and dnsmasq for DNS resolving.

But maybe someone else has another idea or wants to add to that.

By the way: if you plan to do this regularly, there are routers which can use 3G usb devices directly also. Might be more straight forward (and stable) connection.

Offline

#7 2012-05-13 19:08:39

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Strike0 wrote:

Now you get me confused on what you want to do with that "eth0 is connected to the wlan input on the router". .

Sorry, my mistake, I mis-typed ... I meant eth0 on my PC is connected to the WAN (wide area network) input on my router, not wlan ...


Strike0 wrote:

The other one is using hostapd on your PC with the 3G device to forward that connection out via eth0 (i.e. what used to be bridge). That you do with the iptables forward and dnsmasq for DNS resolving. .

That is where my confusion comes in, if I use dnsmasq doesn't that give my eth0 interface a static IP, all I want is it to pass thorugh the IP of the wwan0 interface (i.e the one it got from the phone network)
.. or can I not do that ..

Strike0 wrote:

By the way: if you plan to do this regularly, there are routers which can use 3G usb devices directly also. Might be more straight forward (and stable) connection.

I am aware of that option, but why spend the money on a new router when I am using the PC 24/7 anyway (it is my media box and server).

Thanks for the help.

Offline

#8 2012-05-13 20:52:48

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

bmentink wrote:

That is where my confusion comes in, if I use dnsmasq doesn't that give my eth0 interface a static IP, all I want is it to pass thorugh the IP of the wwan0 interface (i.e the one it got from the phone network)
.. or can I not do that ..

You definetely want your eth0 to get a static IP. But maybe you get along without dnsmasq, yes.
I have not done what you want to try, perhaps someone else has.

How about you try the following with networkmanager up to step 6-
https://wiki.archlinux.org/index.php/In … structions
-and from step 6 virtually as described there.

Offline

#9 2012-05-14 07:18:35

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Hi,

Ok I have this working now, here are the steps I used.

1. Allowed NetworkManager to setup the 3G Interface wwan0 with DHCP ..
2. Disabled my eth0 interface from Networkmanager by putting an entry in /etc/Networkmanager/Networkmanager.conf
3. Manually configured eth0 with a static IP of 192.168.0.1
4. did the "echo 1 > /proc/sys/net/ipv4/ip_forward" thing for IP forwarding
5. did the following with iptables:

 iptables -t nat -A POSTROUTING -o wwan0 -j MASQUERADE
rc.d save iptables
rc.d start iptables

6. Connected my wireless router "wan" port to eth0 and configured for 192.168.0.2 IP address and DNS servers dished up from the network  ..
( .. looked at the entries in /etc/resolve.conf on the PC I am sharing the internet )

I can then connect to my wireless lan with my other computers..and on to the internet ... yahoo .. :-)

The only issue I have with this setup is getting the 3G interface to connect automatically to the network .. I ticked the box in networkmanager, but it doesn't seem to work
if I reboot the PC or take the usb T stick out and plug back in, I have to manually connect to the network with networkmanager. Does anyone know how to do this automatically ..
[edit] seems this is a known bug ... you can only auto connect when the interface power is set to "on", but stupidly it defaults to "off"

Thanks,
B.

Last edited by bmentink (2012-05-14 07:56:04)

Offline

#10 2012-05-14 17:05:07

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Great to hear you got it working.
Have a look here for that autoconnect issue.
One other point: You should also be able to let networkmanager configure that static eth0 IP, but if it works like this .. why change.

Offline

#11 2012-05-14 21:55:14

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Network bridge problems linking wwan0 and eth0 [SOLVED]

Thanks. I will try the script when I get home .... good find!

PS: I could not get networkmanager to setup the eth0 interface correctly with a static IP. The reason is that the interface eth0 is connected to my router via a power-line modem, so it keeps trying to connect using that interface (re-trying etc).  So killing networkmanager from using that interface andbringing it up via rc.conf works just fine ..

EDIT: The script works great to auto-connect a mobile broadband interface ... marking this thread solved.

Last edited by bmentink (2012-05-15 22:01:39)

Offline

Board footer

Powered by FluxBB