]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/tools/net80211/scripts/setup.wpa1.aes
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / tools / net80211 / scripts / setup.wpa1.aes
1 #! /bin/sh
2 #
3 # Script for testing WPA1 w/ AES.
4 #
5 # $FreeBSD$
6 #
7 PATH=.:$PATH
8 . config
9
10 BRIDGE=bridge0
11 WLAN=wlan0
12 SSID=$SSID-wpa
13 CONF=$TMPDIR/bsd-$WLAN.conf
14
15 makeconf()
16 {
17         conf=$1
18         rm -f $conf
19         cat >$1 <<EOF
20 interface=$WLAN
21 ctrl_interface=$HOSTAPD_CTRL_INTERFACE
22 logger_syslog=-1
23 logger_syslog_level=0
24 logger_stdout=-1
25 logger_stdout_level=0
26 debug=4
27 wpa=1
28 wpa_key_mgmt=WPA-PSK
29 wpa_passphrase=$WPA_PASSPHRASE
30 wpa_pairwise=CCMP
31 EOF
32 }
33
34 trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
35         rm -f $CONF" 2
36
37 ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
38 #wlandebug -i $WLAN assoc+crypto
39 wlandebug -i $WLAN assoc
40 ifconfig $WLAN ssid $SSID
41 ifconfig $WLAN channel $CHANNEL
42 ifconfig $WLAN mtu 1500         # NB: if_bridge requires matching mtu's
43
44 ifconfig $BRIDGE create
45 ifconfig $BRIDGE addm $WIRED addm $WLAN up
46 ifconfig $WLAN up
47 ifconfig $WIRED up
48
49 ifconfig
50
51 makeconf $CONF
52 #mwldebug -i $WIRELESS keycache
53 start_hostapd -K $CONF