views:

266

answers:

1

Hi All, I'm doing the reverse of what it seems most people do when bridging an ethernet and wireless interface. I have one box without a wireless card, and I want to provide access to the internet through the box next to it which has both a wireless card and an ethernet card. The wireless card accesses the internet through a wireless router which serves as the dhcp server on the private network 192.168.0.*. The router's dhcp server is configured to never assign any of the static ip address below.

I've configured the bridge in /etc/network/interfaces, and no problems are reported when I bring up br0. The problem is that after bringing up the bridge, neither computer can access the internet. Here are the details of my configuration:

/etc/network/interfaces:

allow-hotplug eth0
iface eth0 inet static
  address       192.168.0.15
  netmask       255.255.255.0
  broadcast     192.168.0.255

auto wlan0
iface wlan0 inet dhcp
pre-up iwconfig wlan0 channel 4 key <my-key> essid <my-essid> mode Managed

iface br0 inet static
  gateway 192.168.0.1
  address 192.168.0.10
  netmask 255.255.0.0
  broadcast 192.168.0.255
  network 192.168.0.0
  bridge_ports wlan0 eth0
  pre-up iwconfig wlan0 channel 4 key <my-key> essid <my-essid> mode Managed

The wireless connection works fine when used alone, and the routing looks like:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
link-local      *               255.255.0.0     U     1000   0        0 wlan0
default         localhost       0.0.0.0         UG    0      0        0 wlan0

When I bring up br0 the routing table is identical with the exception that the Iface for each entry is br0, and it takes a significant amount of time to return the 'default' entry.

The other difference I noticed was when I list the interfaces using ifconfig, wlan0 no longer shows an IP address after bringing up br0.

The error returned when trying to ping either the router (192.168.0.1) or a public internet address is: 'Destination Host Unreachable' from br0's IP: 192.168.0.10.

Any ideas?

Thanks, Jivan

+1  A: 

Get rid of all the config for eth0 and wlan0, and just have a br0 entry:

iface br0 inet dhcp
  bridge_ports wlan0 eth0
  pre-up iwconfig wlan0 channel 4 key <my-key> essid <my-essid> mode Managed

Bringing up br0 should do the right thing with wlan0 and eth0 (they don't have their own IP addresses - instead br0 is now your box's interface to the bridged network.

caf
When I try to bring up br0 using this configuration it doesn't get any DHCP offers. I checked the router's DHCP settings, and they look fine. The interface alias that is automatically created 'br0:avahi' has an addresses in the 169.254.*.* range. I'm assuming this is just a default that would be updated if DHCP were to succeed.
It sounds like your `br0` interface is choosing the `eth0` MAC address to use, and your wlan driver doesn't support the necessary magic to make bridging work. You'll have to use another solution, like proxyarp.
caf