OpenWrt Forum Archive

Topic: Bridging

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

im trying to set up a bridge between an opnenvpn tap device and the ath0 wifi device of my router. unfortunately the i don't get the bridge working.

as an excercise i tried to manually set up a bridge between the eth0 and ath0 device.
when configuring /etc/wireless and /etc/network to set up this bridge everything works fine.
when i set up the bridge manually it does not work.

here is what i'm doing:
(/etc/network and /etc/wireless are not creating any bridges)

brctl addbr br0
ip link set br0 up
brctl addif br0 eth0
brctl addif br0 ath0

unfortunately wireless clients dont get access to the eth0 network.

what am i doing wrong / what are the openwrt scripts doing when setting up the eth0<->ath0 bridge

ok i figured out that the problem is the psk encryption on ath0. if i configure /etc/wireless not to do any encryption bridging works fine.
as openwrt is able to set up a bridge between eth0 and ath0 with ath0 running with psk encryption i bet the order in that the devices (bridge ath0) are configured is important.
if anyone has a better idea please let me know.

ok i finally got this working.
as far as i understand the problem is that the tkip key renewal in bridges is problematic.
therfore hostapd has to be aware of the bridge.
what i did is the following:

remove all "config wifi-iface" configuration from /etc/config/wireless
make a script that is run on boot doing the following:
(i'm using ip from the iproute2 package (ipkg install ip))

brctl addbr br0
ip link set br0 up
brctl addif br0 eth0
wlanconfig ath0 create wlandev wifi0 wlanmode ap
hostapd -B /etc/wificonfig/hostapd-ath0.conf

that's it.
before running the commands create the file /etc/wificonfig/hostapd-ath0.conf with the following content:
driver=madwifi
interface=ath0
bridge=br0
ssid=OpenWrt
debug=0
wpa=1
wpa_pairwise=TKIP
wpa_passphrase=secret
------
the bridge=br0 line is the line causing me the problems

The discussion might have continued from here.