nrelease - fix/improve livecd
[dragonfly.git] / tools / tools / net80211 / scripts / setup.mixed
1 #! /bin/sh
2 #
3 # Script for testing multi-bss open+WPA1+WPA2.
4 #
5 # $FreeBSD: src/tools/tools/net80211/scripts/setup.mixed,v 1.1 2008/04/20 20:43:42 sam Exp $
6 #
7 PATH=.:$PATH
8 . config
9
10 BRIDGE=bridge0
11 WPA_WLAN=wlan0
12 CONF=$TMPDIR/bsd-$WPA_WLAN.conf
13 WPA_SSID=$SSID-wpa
14 OPEN_WLAN=wlan1
15
16 makeconf()
17 {
18         conf=$1
19         rm -f $conf
20         cat >$conf <<EOF
21 interface=$2
22 ctrl_interface=$HOSTAPD_CTRL_INTERFACE
23 logger_syslog=-1
24 logger_syslog_level=0
25 logger_stdout=-1
26 logger_stdout_level=0
27 debug=4
28 wpa=3
29 wpa_key_mgmt=WPA-PSK
30 wpa_passphrase=$WPA_PASSPHRASE
31 wpa_pairwise=CCMP
32 EOF
33 }
34
35 trap "ifconfig $BRIDGE destroy; ifconfig $WPA_WLAN destroy; \
36      ifconfig $OPEN_WLAN destroy; rm -f $CONF" 2
37
38 ifconfig $WPA_WLAN create wlandev $WIRELESS wlanmode hostap bssid
39 #wlandebug -i $WPA_WLAN assoc+crypto
40 wlandebug -i $WPA_WLAN state+assoc+11n
41 ifconfig $WPA_WLAN ssid $WPA_SSID
42 ifconfig $WPA_WLAN channel $CHANNEL
43 ifconfig $WPA_WLAN mtu 1500             # NB: if_bridge requires matching mtu's
44
45 ifconfig $OPEN_WLAN create wlandev $WIRELESS wlanmode hostap bssid
46 #wlandebug -i $OPEN_WLAN assoc+crypto
47 wlandebug -i $OPEN_WLAN state+assoc+11n
48 ifconfig $OPEN_WLAN ssid $SSID
49 ifconfig $OPEN_WLAN channel $CHANNEL
50 ifconfig $OPEN_WLAN mtu 1500            # NB: if_bridge requires matching mtu's
51
52 ifconfig $BRIDGE create
53 ifconfig $BRIDGE addm $WIRED addm $WPA_WLAN addm $OPEN_WLAN up
54 ifconfig $WPA_WLAN up
55 ifconfig $OPEN_WLAN up
56 ifconfig $WIRED up
57
58 ifconfig
59
60 makeconf $CONF $WPA_WLAN
61 #athdebug -i $WIRELESS keycache
62 start_hostapd -K $CONF