User Tools

Site Tools


doc:recipes:broadcomwds

Broadcom WDS (brcm-2.4 only)

The brcm-2.4 platform using the proprietary wl.o driver implements AP-to-AP WDS to connect two or more devices wirelessly to form one common broadcast domain.

This configuration is for routers based on the Broadcom chipset and will not work for routers that are on other platforms, such as Atheros chipsets - see WDS (Atheros).

In contrast to Bridged Client the WDS allow to extend the Wireless access area using more than two routers. You need to have control over all routers and they should have compatible WDS implementations.

WEP and WPA-PSK or WPA2-PSK encryption is possible.

Configuration

Relevant configuration files:

:!: The changes below assume an OpenWrt Kamikaze or Backfire version. It is assumed that the wireless has already been enabled and that the AP network was configured properly, if not you can visit: Bridged Access Point

First of all, determine the MAC addresses on your devices:

root@wds-test-1:~# ifconfig wl0 wl0 Link encap:Ethernet HWaddr 00:16:01:0A:B2:8F BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:5133 errors:0 dropped:0 overruns:0 frame:97274 TX packets:5157 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:495642 (484.0 KiB) TX bytes:538242 (525.6 KiB) Interrupt:2 Base address:0x5000

On the second box:

root@wds-test-2:~# ifconfig wl0 wl0 Link encap:Ethernet HWaddr 00:14:BF:3B:B9:53 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5138 errors:0 dropped:0 overruns:0 frame:19653 TX packets:5171 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:496132 (484.5 KiB) TX bytes:539222 (526.5 KiB) Interrupt:4 Base address:0x1000

So we now have the addresses:

Host MAC
wds-test-1 00:16:01:0A:B2:8F
wds-test-2 00:14:BF:3B:B9:53

Step 1: Configure Device 1 (wds-test-1)

In this example we'll use a bridged setup, means we bridge the WDS vif to the existing br-lan interface.
This way we only need one IP for all three networks (LAN, AP, WDS) and traffic can flow in all directions.

Edit the /etc/config/wireless file and define a second wireless network in addition to the AP:

config wifi-iface option device wl0 option network lan option mode wds option bssid 00:14:BF:3B:B9:53 # option encryption psk2 # option key 'secret_key'
  • network lan - attach this wireless network to the br-lan bridge
  • mode wds - enable WDS mode
  • bssid 00:14:BF:3B:B9:53 - specify the peer address, this is the wireless MAC of wds-test-2
  • Optionally un-comment the last two lines to enable WPA encryption


Open the /etc/config/firewall file and set the forward policy in the LAN zone to accept:

config zone option name lan option input ACCEPT option output ACCEPT option forward ACCEPT

Finally edit the network configuration in /etc/config/network and enable the spanning tree protocol:

config interface lan option type bridge option stp 1 option ifname eth0.0 option proto static option ipaddr 192.168.1.1 option netmask 255.255.255.0

Step 2: Configure Device 2 (wds-test-2)

Like on Device 1, add a WDS network to /etc/config/wireless:

config wifi-iface option device wl0 option network lan option mode wds option bssid 00:16:01:0A:B2:8F # option encryption psk2 # option key 'secret_key'
  • bssid 00:16:01:0A:B2:8F - this is the wireless MAC of wds-test-1


Open the /etc/config/firewall file and set the forward policy in the LAN zone to accept:

config zone option name lan option input ACCEPT option output ACCEPT option forward ACCEPT

Proceed with the network configuration in /etc/config/network, enable the spanning tree protocol and change the IP address to avoid a collision with Device 1:

config interface lan option type bridge option stp 1 option ifname eth0.0 option proto static option ipaddr 192.168.1.2 option netmask 255.255.255.0

Disable DHCP on the LAN interface in /etc/config/dhcp since Device 1 will serve local hosts:

config dhcp lan option ignore 1 option interface lan option start 100 option limit 150 option leasetime 12h

Further Information

  • The AP SSID should be the same on all WDS peers
  • You can setup multiple WDS links per device, define one extra wifi-iface section for each WDS link
  • WPA is only possible with WDS, if at least one AP and one or more WDS networks are defined with the same crypto settings (encryption, key) on all
  • To troubleshoot a WDS connection, install the wl utility with opkg and run the following commands:
    • wl wds - print the WDS peer addresses, compare them carefully with the MAC addresses of your devices
    • wl sta_info <peer_mac> - show the connection state of a remote WDS peer. State should be "AUTHORIZED".
  • If WDS doesn't go 'AUTHORIZED' try setting mode to 802.11g only on all WDS devices.

Complete Configuration Files

Below are all involved configuration files listed, changed options are highlighted.

Device 1

root@wds-test-1:~# cat /etc/config/wireless config wifi-device wl0 option type broadcom option channel 3 config wifi-iface option device wl0 option mode ap option network lan option ssid OpenWrt-WDS option encryption psk2 option key 'secret_key' config wifi-iface option device wl0 option network lan option mode wds option bssid 00:14:BF:3B:B9:53 option encryption psk2 option key 'secret_key'
root@wds-test-1:~# cat /etc/config/network config switch eth0 option vlan0 '1 2 3 4 5*' option vlan1 '0 5' config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option type bridge option stp 1 option ifname eth0.0 option proto static option ipaddr 192.168.1.1 option netmask 255.255.255.0 config interface wan option ifname eth0.1 option proto dhcp
root@wds-test-1:~# cat /etc/config/firewall config defaults option syn_flood 1 option input ACCEPT option output ACCEPT option forward REJECT config zone option name lan option input ACCEPT option output ACCEPT option forward ACCEPT config zone option name wan option input REJECT option output ACCEPT option forward REJECT option masq 1 option mtu_fix 1 config forwarding option src lan option dest wan config rule option src wan option proto udp option dest_port 68 option target ACCEPT config include option path /etc/firewall.user
root@wds-test-1:~# cat /etc/config/system config system option timezone UTC option hostname wds-test-1

Device 2

root@wds-test-2:~# cat /etc/config/wireless config wifi-device wl0 option type broadcom option channel 3 config wifi-iface option device wl0 option mode ap option network lan option ssid OpenWrt-WDS option encryption psk2 option key 'secret_key' config wifi-iface option device wl0 option network lan option mode wds option bssid 00:16:01:0A:B2:8F option encryption psk2 option key 'secret_key'
root@wds-test-2:~# cat /etc/config/network config switch eth0 option vlan0 '1 2 3 4 5*' option vlan1 '0 5' config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option type bridge option stp 1 option ifname eth0.0 option proto static option ipaddr 192.168.1.2 option netmask 255.255.255.0 config interface wan option ifname eth0.1 option proto dhcp
root@wds-test-2:~# cat /etc/config/firewall config defaults option syn_flood 1 option input ACCEPT option output ACCEPT option forward REJECT config zone option name lan option input ACCEPT option output ACCEPT option forward ACCEPT config zone option name wan option input REJECT option output ACCEPT option forward REJECT option masq 1 option mtu_fix 1 config forwarding option src lan option dest wan config rule option src wan option proto udp option dest_port 68 option target ACCEPT config include option path /etc/firewall.user
root@wds-test-2:~# cat /etc/config/dhcp config dnsmasq option domainneeded 1 option boguspriv 1 option filterwin2k 0 option localise_queries 1 option local /lan/ option domain lan option expandhosts 1 option nonegcache 0 option authoritative 1 option readethers 1 option leasefile /tmp/dhcp.leases option resolvfile /tmp/resolv.conf.auto config dhcp lan option ignore 1 option interface lan option start 100 option limit 150 option leasetime 12h config dhcp wan option interface wan option ignore 1
root@wds-test-2:~# cat /etc/config/system config system option timezone UTC option hostname wds-test-2
doc/recipes/broadcomwds.txt · Last modified: 2012/12/02 14:55 by daniellek