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