Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

WDS Bridging

It is possible to set up a WDS bridge fairly easily using MadWifi. Follow these instructions:

Make sure you install bridge-utils before trying to use the brctl command.

First set up an ap, then a station. Then have the station associate with a target AP. Then bring up the AP and enable bridging between the two devices. Like this:

wlanconfig ath0 create wlandev wifi0 wlanmode ap
wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon # NOTE: nosbeacon is no longer required since r3476
iwconfig ath1 essid "target AP"         # bring up the station first
iwpriv ath1 wds 1                       # enable bridging mode on sta
iwconfig ath0 channel "choose_a_channel" essid "local AP name"
iwpriv ath0 wds 1                       # enable bridging mode on ap
ifconfig ath0 0.0.0.0 up                # be sure to bring up the interfaces
ifconfig ath1 0.0.0.0 up                #
brctl addbr br0                         # create a bridge device
brctl addif br0 ath0                    # add the wireless devices
brctl addif br0 ath1
echo 1 > /proc/sys/net/ipv4/ip_forward  # make sure, kernel allowed to pass packets between interfaces.
ifconfig br0 [ip address for bridge] up

Note also that ip address for each of the ath devices in this example can be set. It is possible to ping both the sta device and the ap device.

Alternate option

According to ticket:91 the following works.

Thanks to the vap interface created by the wlanconfig there is a device per wds link. So the normal linux bridge is able to handle the traffic.

So to create a wds link you should (a WORKING solution follows):

wlanconfig ath0 create wlandev wifi0 wlanmode ap    # Create an AP
brctl addbr br0                                     # Create a bridge
iwpriv ath0 mode <mode>                             # Choose operative mode (1,2 or 3): 
                                                    # 1 = 802.11a
                                                    # 2 = 802.11b
                                                    # 3 = 802.11g  
iwconfig ath0 essid <your_essid> channel <channel>
iwpriv ath0 wds 1
ifconfig ath0 up                                    # Bring up the interface and next up to the bridge
brctl addif br0 ath0
ifconfig br0 <IP/Netmask> up                        # Bring up the bridge
wlanconfig ath1 create wlandev wifi0 wlanmode wds   # Now create a station
iwpriv ath1 mode 1
iwconfig ath1 channel 36
iwpriv ath1 wds_add <MAC_of_other_card>
iwpriv ath1 wds 1
ifconfig ath1 up
brctl addif br0 ath1
echo 1 > /proc/sys/net/ipv4/ip_forward  # make sure, kernel allowed to pass packets between interfaces.

If you want to create a WDS between 3 nodes, you have to create TWO station (one for each other station). With 4 nodes, 3 station on every configuration and so on...


Special Case: Bridging AP over WDS

There is a scenario where WDS traffic will not be properly bridged.

Let's say you create an AP VAP and it has the same MAC as the base device. Then you create some WDS links (one or more) and these are also assigned to the same MAC as the AP. Now, put these into a bridge so you can bridge AP station traffic over the WDS link.

What you will get is a AP, WDS links and bridge all with the same MAC address and things get very confused. This is not a problem if an Ethernet device is on the bridge and the bridge takes that port's MAC address.

Anyway, if the bridge MAC is the same as the AP VAP the AP seems to think it is the destination of the packet and it goes no farther.

The workaround is to make sure that the bridge gets a different MAC from the AP. In older kernels bridges take the lowest MAC address of all enslaved devices, while newer kernels allow you to override this selection.

The workaround is to use a cloned BSSID for any and all the APs but let the WDS nodes have the base MAC address. What this does is forces the bridge MAC to be the lower address (the WDS node(s) MAC and not one of the AP mac(s)). This allows traffic to flow normally over the bridge.

In many configurations the older (lower) OUI will be on the wired Ethernet ports so you won't encounter this problem on typical AP->wired bridging but with WDS links it can get interesting as I have described.

Use the "uniquebssd" (bssid prior to r3476) parameter to wlanconfig to force the use of alternate MACs from the parent device's manufacturer assigned MAC.


Additional WDS information can be found on AboutWDS.