hostapd AP模式 2.4G/5G

问题:连接不稳定,经常掉线,电脑连接上link speed速率仅有6~46Mb/s,手机上433Mb/s

引用来源:5G时,hostapd的信道只能有以下几个

int allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
149, 157, 184, 192 };

hostapd_2.4g.conf

 1 #ctrl_interface=/var/run/hostapd
 2 interface=wlan0
 3 driver=nl80211
 4 ssid=HHQJ_IMX334
 5 channel=9
 6 macaddr_acl=0
 7 auth_algs=1
 8 hw_mode=g
 9 ignore_broadcast_ssid=0
10 wpa=2
11 wpa_passphrase=12345678
12 wpa_key_mgmt=WPA-PSK
13 wpa_pairwise=TKIP CCMP
14 rsn_pairwise=CCMP TKIP

hostapd_5g.conf

参考: How to configure hostapd for a 5Ghz network

设置了信道和硬件模式hw_mode = a;

 1 #ctrl_interface=/var/run/hostapd
 2 interface=wlan0
 3 hw_mode=a
 4 driver=nl80211
 5 channel=149
 6 auth_algs=1
 7 #ieee80211d=1
 8 #country_code=CN
 9 ieee80211n=1
10 ieee80211ac=1
11 wmm_enabled=1
12 wpa=2
13 ssid=HHQJ_IMX334
14 wpa_passphrase=12345678
15 wpa_key_mgmt=WPA-PSK
16 wpa_pairwise=CCMP
17 rsn_pairwise=CCMP

一开始没有加上ieee80211n=1,PC端的协商速率最高只有54Mb/s, 加上后PC端就有433Mb/s,不知道什么原因

相关配置文件:

start_hostapd.sh

#!/bin/sh

dir=`dirname $0`
cd $dir
modprobe ahci.ko
modprobe bcmdhd.ko
sleep 3

hostapd /etc/hostapd_5G_1.conf -B
sleep 3
ifconfig wlan0 192.168.1.2
udhcpd /etc/udhcpd.conf
#udhcpc -i wlan0& 
原文地址:https://www.cnblogs.com/y4247464/p/14006702.html