]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/tools/net80211/scripts/setup.wdsmain
Merge ^/head r317281 through r317502.
[FreeBSD/FreeBSD.git] / tools / tools / net80211 / scripts / setup.wdsmain
1 #! /bin/sh
2 #
3 # Setup an ap that accepts wds traffic from associated stations.
4 # This can be used as the "back end" for setup.extender and/or
5 # setup.repeater.  Note that the wds vap's are created by the
6 # wlanwds program that listens for wds discovery events (to create
7 # wds vaps) and for sta leave events (to destroy wds vaps it
8 # created).  The WDSUP script is invoked for each wds vap that
9 # gets created--to add the vap to a bridge.
10 #
11 # Notes!
12 #
13 # * If the main AP VAP is running with encryption, the plumbed up
14 #   WDS VAP needs to have privacy enabled (wepmode mixed, for example)
15 #   otherwise frames transmitted from the WDS AP to the WDS STA
16 #   will not be encrypted.
17 #
18 # $FreeBSD$
19 #
20 PATH=.:$PATH
21 . config
22
23 SSID='freebsd+wdsmain'
24 WDSUP=$TMPDIR/wdsup$$
25
26 #mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
27 WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
28 ifconfig $WLAN_AP ssid "$SSID" channel $CHANNEL mtu 1500
29 ifconfig $WLAN_AP dwds -apbridge
30 wlandebug -i $WLAN_AP state+scan+assoc+auth+wds+11n
31
32 BRIDGE=`ifconfig bridge create`
33
34 # NB: start wlanwds first to avoid races.
35 rm -f $WDSUP
36 cat >$WDSUP <<EOF
37 #! /bin/sh
38 DEV=\$1
39 ifconfig $BRIDGE addm \$DEV
40 ifconfig \$DEV up
41 EOF
42 chmod +x $WDSUP
43 $WLANWDS -v -s $WDSUP &
44
45 ifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
46 ifconfig $WIRED up
47 ifconfig $WLAN_AP up