1#! /bin/sh 2# 3# Setup a wireless extender/relay: extend a wireless network using 4# dwds. We create an ap vap and a station vap; then enable 5# dwds on the sta. The sta vap associates to another ap and passes 6# traffic from stations associated to the (local) ap. The sta 7# will follow it's peer ap, dragging the ap vap with it. 8# 9# 10PATH=.:$PATH 11. config 12 13AP_SSID='freebsd+wdsrelay' 14WDS_SSID='freebsd+wdsmain' 15#WDS_SSID='WDS1' 16 17#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2 18WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS` 19ifconfig $WLAN_AP ssid "$AP_SSID" mtu 1500 -apbridge 20wlandebug -i $WLAN_AP state+assoc+wds+11n 21 22WLAN_STA=`ifconfig wlan create wlanmode sta wlandev $WIRELESS -beacons` 23ifconfig $WLAN_STA ssid "$WDS_SSID" dwds -bgscan 24wlandebug -i $WLAN_STA state+assoc+auth+wds+scan+11n 25# no TSO in the bridge, no AMPDU until fw works right 26ifconfig $WLAN_STA -tso -ampdu 27 28BRIDGE=`ifconfig bridge create` 29ifconfig $BRIDGE addm $WLAN_AP addm $WLAN_STA up 30# NB: bring sta up first so it can locate it's AP 31ifconfig $WLAN_STA up 32ifconfig $WLAN_AP up 33 34#ifconfig $WIRED down delete 35