📄 ap.wlan
字号:
#! /bin/sh
# Solomon family 802.11a/b/g Wireless PCI Card AP mode setup script
#
###############################################################################
#
# Notice! make sure your bridge function(brctl) and ethernet port is work.
# AP mode needs bridge function to route packet from wireless to ethernet port.
#
###################### Wireless AP Settings ###################################
# wireless & ethernet interface
WIRELESS_DEVICE=eth1
ETHERNET_DEVICE=eth0
# AP bridge name
AP_NAME=apbr0
# AP IP address
IP_ADDR=192.168.100.1
# Setup Variables.
DESIRED_SSID="TestAP" # ["xxx"] Service Set ID for used(Max 32)
BSSTYPE=ap # [ap] AP mode
CHANNEL=6 # [1..14] default AP startup channel
BCN_INT=200 # [20..1000] beacon interval(ms)
AUTHTYPE=open # [open|share]authentication mode
BASIC_RATE=15 # bit0=1Mbps, bit1=2Mbps, bit2=5.5Mbps, bit3=11Mbps
PHY_TYPE=2 # 802.11b=1, 802.11g=2
# WEP settings.
WEP_ENABLE=no # [yes|no] to enable WEP
WEP_DEFKEY=0 # [0..3] Key Index for transmit
# WEP key
# [no|"xx:xx:xx:xx:xx"] no key or 40bit(10-hex)/104(26-hex) wep key
WEP_KEY0="11:22:33:44:55" # 40 bit wep key
WEP_KEY1=no
WEP_KEY2=no
WEP_KEY3=no
###################### Settings End ###########################################
###################### Script Begin ###########################################
ifconfig $WIRELESS_DEVICE down
ifconfig $ETHERNET_DEVICE down
/usr/sbin/brctl addbr $AP_NAME
/usr/sbin/brctl addif $AP_NAME $WIRELESS_DEVICE
/usr/sbin/brctl addif $AP_NAME $ETHERNET_DEVICE
ifconfig $WIRELESS_DEVICE up 0.0.0.0
ifconfig $ETHERNET_DEVICE up 0.0.0.0
ifconfig $AP_NAME up $IP_ADDR
# Set your wep keys, if present
if [ "$WEP_ENABLE" = "yes" ] ; then
/sbin/wetctl $WIRELESS_DEVICE privacy \
$WEP_DEFKEY \
key0 $WEP_KEY0 \
key1 $WEP_KEY1 \
key2 $WEP_KEY2 \
key3 $WEP_KEY3
fi
if [ "$WEP_ENABLE" = "no" ] ; then
/sbin/wetctl $WIRELESS_DEVICE privacy off
fi
# startup networks
/sbin/wetctl $WIRELESS_DEVICE apstart \
$BSSTYPE \
$DESIRED_SSID \
$CHANNEL \
$BCN_INT \
$AUTHTYPE \
$BASIC_RATE \
$PHY_TYPE
echo " "
echo "Start AP with " \
"ESSID=$DESIRED_SSID," \
"at Channel=$CHANNEL"
exit 0
###################### Script End #############################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -