Not able to bridge wired and wireless network
Hi,
I have connected my laptop running alpine linux to internet using my
wired connection (eth0). On my wireless connection (wlan0), I have
created an ad-hoc network and I have also configured a dhcp server.
Other clients are able to connect to this ad-hoc network and they get
assigned with a IP by the dhcp server. Till now, everything is good.
I am trying to share the internet connection on my wired network with
the ad-hoc network by bridging the two networks. Alpine linux’s
bridgeutils package installs with no problems. To enable bridging, I
tried two approaches:
Approach 1:
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 wlan0
The command “brctl show” shows that both the networks are in the bridge; but the bridge does not get enabled. In fact, after doing brctl addif br0 eth0, my laptop itself loses its internet connection.
Approach 2:
add br0 device using “brctl addbr br0”
modify /etc/network/interfaces to
auto wlan0
iface wlan0 inet static
address 192.168.1.20
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-essid alpineadhoc
wireless-key 1212312345
auto br0
iface br0 inet static
address 192.168.1.21
netmast 255.255.255.0
bridge-ports eth0 wlan0
restart networking
The networking restarts with no errors in the system log.
eth0 gets connected to the subnet 192.168.1.X (which is assigned by my
router). But in this case too, my laptop loses internet connectivity
after the network is restarted. The mesh-network is up and clients are
still able to connect to the mesh network. They are able to ping both
wlan0 and br0. But the bridging does’t work.
I have tried searching online, but I could only find that many other users have faced the same problem. I have done this kind of internet sharing in windows (which was very easy) and I guess there would be some way to do it in linux too.
Any suggestions / help from your side would be very useful to us.
Thanks.
(from redmine: issue id 331, created on 2010-03-18, closed on 2010-10-29)