Bridging two wireless NICs in Debian - network unreachable

0

I'm trying to make a DIY wireless repeater using old hardware and Debian, but I'm encountering some difficulties (more details below).

Hardware:

EeePC 900 w/Atheros wireless card (kernel driver ath5k) External wireless card D-Link DWL-0122 (Ralink chip, kernel driver rt73-usb)

Setup:

One wireless AP (auth using WPA-PSK)

Configuration:

/etc/network/interfaces

 auto lo br0
 iface lo inet loopback

 # The primary network interface
 # This is unused
 allow-hotplug eth0
 iface eth0 inet dhcp

 iface wlan0 inet manual
         wpa-ssid myessid
         wpa-psk mypass

 iface wlan1 inet manual
         # To prevent clashes with main AP
         pre-up iwconfig wlan1 mode managed essid "repeater" channel 4

 iface br0 inet static
         address 192.168.10.3
         netmask 255.255.255.0
         network 192.168.10.0
         broadcast 192.168.10.255
         gateway 192.168.10.1
         dns-nameservers 192.168.10.1
         dns-search lan
         bridge_hw 00:1f:c6:8f:15:4e # Same HW address as wlan0
         bridge_ports wlan0 wlan1

The actual repeating is handled by hostapd. However, the problem is that I cannot reach the network. Once the bridge is up, even before hostapd is started, I cannot reach any internal host, let alone external. All pings to the gateway end up in "Destination Host unreachable". What's the best course of action in this case?

I also ensured that the "main" interface, wlan0, is also working properly when non bridged (gets an IP if configured via DHCP, accesses the network). I'm also forced to use bridging since neither of the two interfaces supports master mode.

Einar

Posted 2012-04-29T08:31:32.757

Reputation: 155

Answers

0

Are you sure that you have in fact managed to insert wlan0 (the one that connects to the existing AP) into the bridge? Because the problem is, this is simply not possible. Running brctl show should confirm that the bridging did not succeed. (the link says it's not possible to bridge wireless client interfaces to wired interfaces, but it's true for bridging to any interface, including wireless AP interfaces)

The alternative is to make the "repeater" act as a NAT router. However this has the usual problems that NAT brings (e.g. need for port forwarding, inability to discover hosts on the other side). The link provided explains how to set up NAT.

Ambroz Bizjak

Posted 2012-04-29T08:31:32.757

Reputation: 4 265

brctl show shows both wlan0 and wlan1 in the interfaces. – Einar – 2012-04-29T09:23:26.110

I suppose the reason why brctl doesn't fail is that you're using an old kernel (2.4?) which doesn't yet prohibit such bridging - but it still won't work (it never worked, which is why the kernel developers prohibited the bridging). – Ambroz Bizjak – 2012-04-29T09:26:58.990

It's Debian Squeeze, 2.6.32. – Einar – 2012-04-29T09:29:25.167

@Einar yes, that makes sense, since this bridging was prohibited only in 2.6.33, according to this http://kerneltrap.org/mailarchive/linux-ath5k-devel/2010/3/21/6871553 Again, it won't work, regardless if you manage to put it in the bridge or not.

– Ambroz Bizjak – 2012-04-29T09:50:11.583

I can confirm that it does indeed "work" with old kernels--and at least in some configurations. I've been using wireless and wired bridging for years (and am using it right now, as we speak). Not that this invalidates your answer. – Flimzy – 2012-05-01T20:49:14.493