802.11ac support
Adds support to 802.11ac
This commit is contained in:
30
create_ap
30
create_ap
@ -46,7 +46,9 @@ usage() {
|
|||||||
echo " --hostapd-debug <level> With level between 1 and 2, passes arguments -d or -dd to hostapd for debugging."
|
echo " --hostapd-debug <level> With level between 1 and 2, passes arguments -d or -dd to hostapd for debugging."
|
||||||
echo " --isolate-clients Disable communication between clients"
|
echo " --isolate-clients Disable communication between clients"
|
||||||
echo " --ieee80211n Enable IEEE 802.11n (HT)"
|
echo " --ieee80211n Enable IEEE 802.11n (HT)"
|
||||||
|
echo " --ieee80211ac Enable IEEE 802.11ac (VHT)"
|
||||||
echo " --ht_capab <HT> HT capabilities (default: [HT40+])"
|
echo " --ht_capab <HT> HT capabilities (default: [HT40+])"
|
||||||
|
echo " --vht_capab <VHT> VHT capabilities"
|
||||||
echo " --country <code> Set two-letter country code for regularity (example: US)"
|
echo " --country <code> Set two-letter country code for regularity (example: US)"
|
||||||
echo " --freq-band <GHz> Set frequency band. Valid inputs: 2.4, 5 (default: 2.4)"
|
echo " --freq-band <GHz> Set frequency band. Valid inputs: 2.4, 5 (default: 2.4)"
|
||||||
echo " --driver Choose your WiFi adapter driver (default: nl80211)"
|
echo " --driver Choose your WiFi adapter driver (default: nl80211)"
|
||||||
@ -601,7 +603,9 @@ HIDDEN=0
|
|||||||
ISOLATE_CLIENTS=0
|
ISOLATE_CLIENTS=0
|
||||||
SHARE_METHOD=nat
|
SHARE_METHOD=nat
|
||||||
IEEE80211N=0
|
IEEE80211N=0
|
||||||
|
IEEE80211AC=0
|
||||||
HT_CAPAB='[HT40+]'
|
HT_CAPAB='[HT40+]'
|
||||||
|
VHT_CAPAB=
|
||||||
DRIVER=nl80211
|
DRIVER=nl80211
|
||||||
NO_VIRT=0
|
NO_VIRT=0
|
||||||
COUNTRY=
|
COUNTRY=
|
||||||
@ -615,7 +619,7 @@ HOSTAPD_DEBUG_ARGS=
|
|||||||
REDIRECT_TO_LOCALHOST=0
|
REDIRECT_TO_LOCALHOST=0
|
||||||
|
|
||||||
CONFIG_OPTS=(CHANNEL GATEWAY WPA_VERSION ETC_HOSTS DHCP_DNS NO_DNS HIDDEN ISOLATE_CLIENTS SHARE_METHOD
|
CONFIG_OPTS=(CHANNEL GATEWAY WPA_VERSION ETC_HOSTS DHCP_DNS NO_DNS HIDDEN ISOLATE_CLIENTS SHARE_METHOD
|
||||||
IEEE80211N HT_CAPAB DRIVER NO_VIRT COUNTRY FREQ_BAND
|
IEEE80211N IEEE80211AC HT_CAPAB VHT_CAPAB DRIVER NO_VIRT COUNTRY FREQ_BAND
|
||||||
NEW_MACADDR DAEMONIZE NO_HAVEGED WIFI_IFACE INTERNET_IFACE
|
NEW_MACADDR DAEMONIZE NO_HAVEGED WIFI_IFACE INTERNET_IFACE
|
||||||
SSID PASSPHRASE USE_PSK)
|
SSID PASSPHRASE USE_PSK)
|
||||||
|
|
||||||
@ -1008,7 +1012,7 @@ for ((i=0; i<$#; i++)); do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
GETOPT_ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","hostapd-debug:","redirect-to-localhost","isolate-clients","ieee80211n","ht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","dhcp-dns:","daemon","stop:","list","list-running","list-clients:","version","psk","no-haveged","no-dns","mkconfig:","config:" -n "$PROGNAME" -- "$@")
|
GETOPT_ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","hostapd-debug:","redirect-to-localhost","isolate-clients","ieee80211n","ieee80211ac","ht_capab:","vht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","dhcp-dns:","daemon","stop:","list","list-running","list-clients:","version","psk","no-haveged","no-dns","mkconfig:","config:" -n "$PROGNAME" -- "$@")
|
||||||
[[ $? -ne 0 ]] && exit 1
|
[[ $? -ne 0 ]] && exit 1
|
||||||
eval set -- "$GETOPT_ARGS"
|
eval set -- "$GETOPT_ARGS"
|
||||||
|
|
||||||
@ -1063,11 +1067,20 @@ while :; do
|
|||||||
shift
|
shift
|
||||||
IEEE80211N=1
|
IEEE80211N=1
|
||||||
;;
|
;;
|
||||||
|
--ieee80211ac)
|
||||||
|
shift
|
||||||
|
IEEE80211AC=1
|
||||||
|
;;
|
||||||
--ht_capab)
|
--ht_capab)
|
||||||
shift
|
shift
|
||||||
HT_CAPAB="$1"
|
HT_CAPAB="$1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--vht_capab)
|
||||||
|
shift
|
||||||
|
VHT_CAPAB="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--driver)
|
--driver)
|
||||||
shift
|
shift
|
||||||
DRIVER="$1"
|
DRIVER="$1"
|
||||||
@ -1559,11 +1572,22 @@ fi
|
|||||||
if [[ $IEEE80211N -eq 1 ]]; then
|
if [[ $IEEE80211N -eq 1 ]]; then
|
||||||
cat << EOF >> $CONFDIR/hostapd.conf
|
cat << EOF >> $CONFDIR/hostapd.conf
|
||||||
ieee80211n=1
|
ieee80211n=1
|
||||||
wmm_enabled=1
|
|
||||||
ht_capab=${HT_CAPAB}
|
ht_capab=${HT_CAPAB}
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $IEEE80211AC -eq 1 ]]; then
|
||||||
|
echo "ieee80211ac=1" >> $CONFDIR/hostapd.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$VHT_CAPAB" ]]; then
|
||||||
|
echo "vht_capab=${VHT_CAPAB}" >> $CONFDIR/hostapd.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $IEEE80211N -eq 1 ]] || [[ $IEEE80211AC -eq 1 ]]; then
|
||||||
|
echo "wmm_enabled=1" >> $CONFDIR/hostapd.conf
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "$PASSPHRASE" ]]; then
|
if [[ -n "$PASSPHRASE" ]]; then
|
||||||
[[ "$WPA_VERSION" == "1+2" ]] && WPA_VERSION=3
|
[[ "$WPA_VERSION" == "1+2" ]] && WPA_VERSION=3
|
||||||
if [[ $USE_PSK -eq 0 ]]; then
|
if [[ $USE_PSK -eq 0 ]]; then
|
||||||
|
Reference in New Issue
Block a user