]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/tools/net80211/scripts/setup.wdsmain
Merge lldb trunk r351319, resolve conflicts, and update FREEBSD-Xlist.
[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 # * Because wlanwds is running on the physical interface (for now),
19 #   and NOT the parent VAP, it will create cloned interfaces using
20 #   the MAC address of the physical interface.  So, until that
21 #   whole setup is fixed, please only associate DWDS to the first
22 #   VAP on a physical interface, which shares the MAC address of
23 #   the physical NIC.
24 #
25 # $FreeBSD$
26 #
27 PATH=.:$PATH
28 . config
29
30 SSID='freebsd+wdsmain'
31 WDSUP=$TMPDIR/wdsup$$
32
33 #mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
34 WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
35 ifconfig $WLAN_AP ssid "$SSID" channel $CHANNEL mtu 1500
36 ifconfig $WLAN_AP dwds -apbridge
37 wlandebug -i $WLAN_AP state+scan+assoc+auth+wds+11n
38
39 BRIDGE=`ifconfig bridge create`
40
41 # NB: start wlanwds first to avoid races.
42 rm -f $WDSUP
43 cat >$WDSUP <<EOF
44 #! /bin/sh
45 DEV=\$1
46 ifconfig $BRIDGE addm \$DEV
47 ifconfig \$DEV up
48 EOF
49 chmod +x $WDSUP
50 $WLANWDS -v -s $WDSUP &
51
52 ifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
53 ifconfig $WIRED up
54 ifconfig $WLAN_AP up