mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
test scripts for vaps and other 802.11 features
Supported by: Hobnob and Marvell
This commit is contained in:
parent
6c2ea87d2d
commit
c8887008c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178361
54
tools/tools/net80211/scripts/config
Normal file
54
tools/tools/net80211/scripts/config
Normal file
@ -0,0 +1,54 @@
|
||||
#
|
||||
# Common configuration settings for vap test scripts.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
#
|
||||
# Auto-detect WIRED and WIRELESS.
|
||||
# NB: takes first device of each type; to fix
|
||||
# either specify them before . config.
|
||||
#
|
||||
for i in `ifconfig -l`; do
|
||||
case $i in
|
||||
bge*|em*|re*|nfe*|fxp*|vr*|msk*|tx*|dc*)
|
||||
test -z "$WIRED" && WIRED=$i
|
||||
;;
|
||||
ath*|ral*|zyd*|ural*|rum*|bwi*)
|
||||
test -z "$WIRELESS" && WIRELESS=$i
|
||||
;;
|
||||
esac
|
||||
done
|
||||
test -z "$WIRED" && { echo "No wired device detected!"; exit; }
|
||||
test -z "$WIRELESS" && { echo "No wireless device detected!"; exit; }
|
||||
|
||||
# fixed channel
|
||||
#CHANNEL=${1:-36:a}
|
||||
#CHANNEL=${1:-36:ht/20}
|
||||
CHANNEL=${1:-36}
|
||||
#CHANNEL=${1:-6:g}
|
||||
#CHANNEL=${1:-6:b}
|
||||
|
||||
# default WPA passphrase
|
||||
test -z "$WPA_PASSPHRASE" && WPA_PASSPHRASE='I am not a geek'
|
||||
|
||||
# default ssid for ap vaps
|
||||
test -z "$SSID" && SSID=freebsd-ap
|
||||
|
||||
# directory to create files like hostapd.conf
|
||||
test -z "$TMPDIR" && TMPDIR=.
|
||||
|
||||
test -z "$HOSTAPD_CTRL_INTERFACE" && HOSTAPD_CTRL_INTERFACE=/var/run/hostapd
|
||||
|
||||
# applications (may want ../ for wlan test apps)
|
||||
test -z "$HOSTAPD" && HOSTAPD=/usr/sbin/hostapd
|
||||
test -z "$WLANWATCH" && WLANWATCH=/usr/local/bin/wlanwatch
|
||||
test -z "$WLANWDS" && WLANWDS=/usr/local/bin/wlanwds
|
||||
|
||||
start_hostapd()
|
||||
{
|
||||
for m in wlan_xauth wlan_ccmp wlan_tkip wlan_wep; do
|
||||
kldstat -q -m $m || kldload $m
|
||||
done
|
||||
$HOSTAPD $*
|
||||
}
|
25
tools/tools/net80211/scripts/setup.dfs
Normal file
25
tools/tools/net80211/scripts/setup.dfs
Normal file
@ -0,0 +1,25 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Scrip for testing DFS; setup an AP vap on a DFS channel
|
||||
# then simulate a radar event and verify operation.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
COUNTRY=dk
|
||||
CHANNEL=64:a
|
||||
|
||||
sysctl net.wlan.nol_timeout=60
|
||||
#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN country $COUNTRY
|
||||
ifconfig $WLAN ssid $SSID-$COUNTRY channel $CHANNEL mtu 1500
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
wlandebug -i $WLAN state+scan+assoc+11n
|
||||
ifconfig $WLAN up
|
||||
|
||||
sleep 5; sysctl dev.mwl.0.radar=1
|
17
tools/tools/net80211/scripts/setup.fixed
Normal file
17
tools/tools/net80211/scripts/setup.fixed
Normal file
@ -0,0 +1,17 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing fixed xmit rate handling.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
ifconfig $WLAN ucastrate 24:a ucastrate 7
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
wlandebug -i $WLAN state+scan+assoc
|
||||
ifconfig $WLAN up
|
16
tools/tools/net80211/scripts/setup.local
Normal file
16
tools/tools/net80211/scripts/setup.local
Normal file
@ -0,0 +1,16 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing traffic to the local host (as opposed to bridged).
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
ifconfig $WIRED down delete
|
||||
route flush
|
||||
wlandebug -i $WLAN state+scan+assoc+11n
|
||||
#mwldebug tso
|
||||
ifconfig $WLAN 192.168.0.21/24
|
62
tools/tools/net80211/scripts/setup.mixed
Normal file
62
tools/tools/net80211/scripts/setup.mixed
Normal file
@ -0,0 +1,62 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing multi-bss open+WPA1+WPA2.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
WPA_WLAN=wlan0
|
||||
CONF=$TMPDIR/bsd-$WPA_WLAN.conf
|
||||
WPA_SSID=$SSID-wpa
|
||||
OPEN_WLAN=wlan1
|
||||
|
||||
makeconf()
|
||||
{
|
||||
conf=$1
|
||||
rm -f $conf
|
||||
cat >$conf <<EOF
|
||||
interface=$2
|
||||
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 $WPA_WLAN destroy; \
|
||||
ifconfig $OPEN_WLAN destroy; rm -f $CONF" 2
|
||||
|
||||
ifconfig $WPA_WLAN create wlandev $WIRELESS wlanmode hostap bssid
|
||||
#wlandebug -i $WPA_WLAN assoc+crypto
|
||||
wlandebug -i $WPA_WLAN state+assoc+11n
|
||||
ifconfig $WPA_WLAN ssid $WPA_SSID
|
||||
ifconfig $WPA_WLAN channel $CHANNEL
|
||||
ifconfig $WPA_WLAN mtu 1500 # NB: if_bridge requires matching mtu's
|
||||
|
||||
ifconfig $OPEN_WLAN create wlandev $WIRELESS wlanmode hostap bssid
|
||||
#wlandebug -i $OPEN_WLAN assoc+crypto
|
||||
wlandebug -i $OPEN_WLAN state+assoc+11n
|
||||
ifconfig $OPEN_WLAN ssid $SSID
|
||||
ifconfig $OPEN_WLAN channel $CHANNEL
|
||||
ifconfig $OPEN_WLAN mtu 1500 # NB: if_bridge requires matching mtu's
|
||||
|
||||
ifconfig $BRIDGE create
|
||||
ifconfig $BRIDGE addm $WIRED addm $WPA_WLAN addm $OPEN_WLAN up
|
||||
ifconfig $WPA_WLAN up
|
||||
ifconfig $OPEN_WLAN up
|
||||
ifconfig $WIRED up
|
||||
|
||||
ifconfig
|
||||
|
||||
makeconf $CONF $WPA_WLAN
|
||||
#athdebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
16
tools/tools/net80211/scripts/setup.simple
Normal file
16
tools/tools/net80211/scripts/setup.simple
Normal file
@ -0,0 +1,16 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing simple (single bss) ap operation.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
wlandebug -i $WLAN state+scan+assoc+11n
|
||||
ifconfig $WLAN up
|
24
tools/tools/net80211/scripts/setup.simple2
Normal file
24
tools/tools/net80211/scripts/setup.simple2
Normal file
@ -0,0 +1,24 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing multi-bss ap operation.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
athdebug state
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID-1 channel $CHANNEL mtu 1500
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
wlandebug -i $WLAN state+scan+assoc
|
||||
ifconfig $WLAN up
|
||||
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS bssid`
|
||||
#ifconfig $WLAN ssid $SSID-2 channel $CHANNEL mtu 1500
|
||||
ifconfig $WLAN ssid $SSID-2 mtu 1500 -ht
|
||||
ifconfig $BRIDGE addm $WLAN
|
||||
wlandebug -i $WLAN state+scan+assoc
|
||||
ifconfig $WLAN up
|
15
tools/tools/net80211/scripts/setup.sta
Normal file
15
tools/tools/net80211/scripts/setup.sta
Normal file
@ -0,0 +1,15 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing simple station mode operation.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
SSID=${1:-MarvellAP8x}
|
||||
|
||||
WLAN=`ifconfig wlan create wlandev $WIRELESS`
|
||||
ifconfig $WLAN -ampdutx
|
||||
ifconfig $WLAN ssid $SSID up
|
||||
ifconfig $WIRED down delete
|
55
tools/tools/net80211/scripts/setup.tsn
Normal file
55
tools/tools/net80211/scripts/setup.tsn
Normal file
@ -0,0 +1,55 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing TSN support.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
SSID=$SSID-tsn
|
||||
WLAN=wlan0
|
||||
CONF=$TMPDIR/tsn-$WLAN.conf
|
||||
|
||||
makeconf()
|
||||
{
|
||||
conf=$1
|
||||
rm -f $conf
|
||||
cat >$1 <<EOF
|
||||
interface=$WLAN
|
||||
logger_syslog=-1
|
||||
logger_syslog_level=0
|
||||
logger_stdout=-1
|
||||
logger_stdout_level=0
|
||||
debug=4
|
||||
wpa=1
|
||||
wpa_pairwise=TKIP
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_passphrase=$WPA_PASSPHRASE
|
||||
tsn=1
|
||||
wep_key0=0123456789
|
||||
EOF
|
||||
}
|
||||
|
||||
trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
|
||||
rm -f $CONF" 0
|
||||
|
||||
ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
|
||||
#wlandebug -i $WLAN assoc+crypto
|
||||
wlandebug -i $WLAN state+assoc+11n+crypto
|
||||
ifconfig $WLAN ssid $SSID
|
||||
ifconfig $WLAN channel $CHANNEL
|
||||
ifconfig $WLAN mtu 1500 # NB: if_bridge requires matching mtu's
|
||||
ifconfig $WLAN tsn
|
||||
|
||||
ifconfig $BRIDGE create
|
||||
ifconfig $BRIDGE addm $WIRED addm $WLAN up
|
||||
ifconfig $WLAN up
|
||||
ifconfig $WIRED up
|
||||
|
||||
ifconfig
|
||||
|
||||
makeconf $CONF
|
||||
#mwldebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
26
tools/tools/net80211/scripts/setup.updown
Normal file
26
tools/tools/net80211/scripts/setup.updown
Normal file
@ -0,0 +1,26 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for test vap create+destroy. Also used to verify
|
||||
# resources are reclaimed properly on destroy.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
$WLANWATCH&
|
||||
|
||||
#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
|
||||
while true
|
||||
do
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
wlandebug -i $WLAN state+scan+assoc
|
||||
ifconfig $WLAN up
|
||||
read x
|
||||
ifconfig $WLAN destroy
|
||||
ifconfig $BRIDGE destroy
|
||||
done
|
61
tools/tools/net80211/scripts/setup.updown.wpa
Normal file
61
tools/tools/net80211/scripts/setup.updown.wpa
Normal file
@ -0,0 +1,61 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for test vap create+destroy when using WPA.
|
||||
# Also used to verify resources are reclaimed properly
|
||||
# on vap destroy.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
SSID=$SSID-wpa
|
||||
WLAN=wlan0
|
||||
CONF=$TMPDIR/bsd-$WLAN.conf
|
||||
|
||||
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=0
|
||||
wpa=1
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_passphrase=$WPA_PASSPHRASE
|
||||
wpa_pairwise=CCMP
|
||||
EOF
|
||||
}
|
||||
|
||||
n=0
|
||||
while true; do
|
||||
echo "---- $n"; n=`expr $n + 1`
|
||||
ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
|
||||
wlandebug -i $WLAN assoc
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
|
||||
ifconfig $BRIDGE create
|
||||
ifconfig $BRIDGE addm $WIRED addm $WLAN up
|
||||
ifconfig $WLAN up
|
||||
# ifconfig $WIRED up
|
||||
|
||||
makeconf $CONF
|
||||
start_hostapd $CONF&
|
||||
pid=$!
|
||||
ifconfig
|
||||
|
||||
sleep 2
|
||||
kill $pid
|
||||
ifconfig $WLAN destroy;
|
||||
ifconfig $BRIDGE destroy;
|
||||
rm -f $CONF
|
||||
vmstat -m | grep 80211
|
||||
netstat -m
|
||||
sleep 1
|
||||
done
|
21
tools/tools/net80211/scripts/setup.wds
Normal file
21
tools/tools/net80211/scripts/setup.wds
Normal file
@ -0,0 +1,21 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for setting up a legacy WDS vap.
|
||||
# Assumes an ap vap is already setup.
|
||||
# Can be run multiple times to create multiple WDS vaps.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
#BSSID='00:50:43:20:64:83'
|
||||
#BSSID='00:50:43:20:64:8d'
|
||||
BSSID='00:50:43:20:6f:a9'
|
||||
|
||||
WLAN=`ifconfig wlan create wlanmode wds wlandev $WIRELESS wlanbssid $BSSID wdslegacy`
|
||||
ifconfig $BRIDGE addm $WLAN
|
||||
wlandebug -i $WLAN output+inact+node+11n
|
||||
#ifconfig $WLAN wepkey 1:0x0123456789 deftxkey 1 wep
|
||||
ifconfig $WLAN up
|
40
tools/tools/net80211/scripts/setup.wdsmain
Normal file
40
tools/tools/net80211/scripts/setup.wdsmain
Normal file
@ -0,0 +1,40 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Setup an ap that accepts wds traffic from associated stations.
|
||||
# This can be used as the "back end" for setup.extender and/or
|
||||
# setup.repeater. Note that the wds vap's are created by the
|
||||
# wlanwds program that listens for wds discovery events (to create
|
||||
# wds vaps) and for sta leave events (to destroy wds vaps it
|
||||
# created). The WDSUP script is invoked for each wds vap that
|
||||
# gets created--to add the vap to a bridge.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
SSID='freebsd+wdsmain'
|
||||
WDSUP=$TMPDIR/wdsup$$
|
||||
|
||||
#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
|
||||
WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN_AP ssid "$SSID" channel $CHANNEL mtu 1500
|
||||
ifconfig $WLAN_AP dwds -apbridge
|
||||
wlandebug -i $WLAN_AP state+scan+assoc+auth+wds+11n
|
||||
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
|
||||
# NB: start wlanwds first to avoid races.
|
||||
rm -f $WDSUP
|
||||
cat >$WDSUP <<EOF
|
||||
#! /bin/sh
|
||||
DEV=\$1
|
||||
ifconfig $BRIDGE addm \$DEV
|
||||
ifconfig \$DEV up
|
||||
EOF
|
||||
chmod +x $WDSUP
|
||||
$WLANWDS -v -p $WIRELESS -s $WDSUP &
|
||||
|
||||
ifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
ifconfig $WLAN_AP up
|
35
tools/tools/net80211/scripts/setup.wdsrelay
Normal file
35
tools/tools/net80211/scripts/setup.wdsrelay
Normal file
@ -0,0 +1,35 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Setup a wireless extender/relay: extend a wireless network using
|
||||
# dwds. We create an ap vap and a station vap; then enable
|
||||
# dwds on the sta. The sta vap associates to another ap and passes
|
||||
# traffic from stations associated to the (local) ap. The sta
|
||||
# will follow it's peer ap, dragging the ap vap with it.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
AP_SSID='freebsd+wdsrelay'
|
||||
WDS_SSID='freebsd+wdsmain'
|
||||
#WDS_SSID='WDS1'
|
||||
|
||||
#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
|
||||
WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN_AP ssid "$AP_SSID" mtu 1500 -apbridge
|
||||
wlandebug -i $WLAN_AP state+assoc+wds+11n
|
||||
|
||||
WLAN_STA=`ifconfig wlan create wlanmode sta wlandev $WIRELESS -beacons`
|
||||
ifconfig $WLAN_STA ssid "$WDS_SSID" dwds -bgscan
|
||||
wlandebug -i $WLAN_STA state+assoc+auth+wds+scan+11n
|
||||
# no TSO in the bridge, no AMPDU until fw works right
|
||||
ifconfig $WLAN_STA -tso -ampdu
|
||||
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN_AP addm $WLAN_STA up
|
||||
# NB: bring sta up first so it can locate it's AP
|
||||
ifconfig $WLAN_STA up
|
||||
ifconfig $WLAN_AP up
|
||||
|
||||
#ifconfig $WIRED down delete
|
21
tools/tools/net80211/scripts/setup.wep
Normal file
21
tools/tools/net80211/scripts/setup.wep
Normal file
@ -0,0 +1,21 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing ap mode w/ WEP.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
#mwldebug -i $WIRELESS +node
|
||||
WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
|
||||
ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500
|
||||
#ifconfig $WLAN authmode shared
|
||||
wlandebug -i $WLAN state+scan+assoc+crypto
|
||||
#mwldebug -i $WIRELESS +keycache
|
||||
#ifconfig $WLAN wepkey 1:0x0123456789 deftxkey 1 wepmode mixed
|
||||
ifconfig $WLAN wepkey 1:0x0123456789 deftxkey 1 wep
|
||||
BRIDGE=`ifconfig bridge create`
|
||||
ifconfig $BRIDGE addm $WLAN addm $WIRED up
|
||||
ifconfig $WIRED up
|
||||
ifconfig $WLAN up
|
53
tools/tools/net80211/scripts/setup.wpa
Normal file
53
tools/tools/net80211/scripts/setup.wpa
Normal file
@ -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
|
53
tools/tools/net80211/scripts/setup.wpa1.aes
Normal file
53
tools/tools/net80211/scripts/setup.wpa1.aes
Normal file
@ -0,0 +1,53 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing WPA1 w/ AES.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
WLAN=wlan0
|
||||
SSID=$SSID-wpa
|
||||
CONF=$TMPDIR/bsd-$WLAN.conf
|
||||
|
||||
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=1
|
||||
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 assoc
|
||||
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
|
||||
#mwldebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
53
tools/tools/net80211/scripts/setup.wpa1.tkip
Normal file
53
tools/tools/net80211/scripts/setup.wpa1.tkip
Normal file
@ -0,0 +1,53 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing WPA1 w/ TKIP.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
WLAN=wlan0
|
||||
SSID=$SSID-wpa
|
||||
CONF=$TMPDIR/bsd-$WLAN.conf
|
||||
|
||||
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=1
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_passphrase=$WPA_PASSPHRASE
|
||||
wpa_pairwise=TKIP
|
||||
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 assoc
|
||||
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
|
||||
#mwldebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
54
tools/tools/net80211/scripts/setup.wpa2
Normal file
54
tools/tools/net80211/scripts/setup.wpa2
Normal file
@ -0,0 +1,54 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing WPA2 w/ AES.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
WLAN=wlan0
|
||||
SSID=$SSID-wpa
|
||||
CONF=$TMPDIR/bsd-$WLAN.conf
|
||||
|
||||
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=2
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_passphrase=$WPA_PASSPHRASE
|
||||
wpa_pairwise=CCMP
|
||||
EOF
|
||||
}
|
||||
|
||||
trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
|
||||
rm -f $CONF" 2
|
||||
|
||||
#mwldebug -i $WIRELESS hal
|
||||
ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
|
||||
#wlandebug -i $WLAN assoc+crypto
|
||||
wlandebug -i $WLAN assoc
|
||||
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
|
||||
#mwldebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
54
tools/tools/net80211/scripts/setup.wpa2.tkip
Normal file
54
tools/tools/net80211/scripts/setup.wpa2.tkip
Normal file
@ -0,0 +1,54 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Script for testing WPA2 w/ TKIP.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PATH=.:$PATH
|
||||
. config
|
||||
|
||||
BRIDGE=bridge0
|
||||
WLAN=wlan0
|
||||
SSID=$SSID-wpa
|
||||
CONF=$TMPDIR/bsd-$WLAN.conf
|
||||
|
||||
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=2
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_passphrase=$WPA_PASSPHRASE
|
||||
wpa_pairwise=TKIP
|
||||
EOF
|
||||
}
|
||||
|
||||
trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
|
||||
rm -f $CONF" 2
|
||||
|
||||
#mwldebug -i $WIRELESS hal
|
||||
ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
|
||||
#wlandebug -i $WLAN assoc+crypto
|
||||
wlandebug -i $WLAN assoc
|
||||
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
|
||||
#mwldebug -i $WIRELESS keycache
|
||||
start_hostapd -K $CONF
|
Loading…
Reference in New Issue
Block a user