diff options
Diffstat (limited to 'tools/tools/net80211/scripts/setup.wpa')
-rw-r--r-- | tools/tools/net80211/scripts/setup.wpa | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/tools/net80211/scripts/setup.wpa b/tools/tools/net80211/scripts/setup.wpa new file mode 100644 index 000000000000..8cbc7724e344 --- /dev/null +++ b/tools/tools/net80211/scripts/setup.wpa @@ -0,0 +1,53 @@ +#! /bin/sh +# +# Script for testing single-bss WPA1+WPA2. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +BRIDGE=bridge0 +WLAN=wlan0 +CONF=$TMPDIR/bsd-$WLAN.conf +SSID=$SSID-wpa + +makeconf() +{ + conf=$1 + rm -f $conf + cat >$1 <<EOF +interface=$WLAN +ctrl_interface=$HOSTAPD_CTRL_INTERFACE +logger_syslog=-1 +logger_syslog_level=0 +logger_stdout=-1 +logger_stdout_level=0 +debug=4 +wpa=3 +wpa_key_mgmt=WPA-PSK +wpa_passphrase=$WPA_PASSPHRASE +wpa_pairwise=CCMP +EOF +} + +trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \ + rm -f $CONF" 2 + +ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap +#wlandebug -i $WLAN assoc+crypto +wlandebug -i $WLAN state+assoc+11n +ifconfig $WLAN ssid $SSID +ifconfig $WLAN channel $CHANNEL +ifconfig $WLAN mtu 1500 # NB: if_bridge requires matching mtu's + +ifconfig $BRIDGE create +ifconfig $BRIDGE addm $WIRED addm $WLAN up +ifconfig $WLAN up +ifconfig $WIRED up + +ifconfig + +makeconf $CONF +#athdebug -i $WIRELESS keycache +start_hostapd -K $CONF |