Xubuntu16.04系统中create_ap开启5G网络的踩坑记录

Xubuntu16.04系统中安装create_ap创建无线AP:
https://blog.csdn.net/qq_45445740/article/details/133972642?spm=1001.2014.3001.5501

1.create_ap.conf 配置文件解析

/etc/create_ap.conf

CHANNEL=default:无线热点的频道设置为默认信道。
GATEWAY=10.0.0.1:设置无线热点的网关地址为10.0.0.1。
WPA_VERSION=2:设置无线热点使用的WPA版本为2。
ETC_HOSTS=0:禁用/etc/hosts文件的解析。
DHCP_DNS=gateway:设置无线热点的DHCP DNS服务器为网关地址。
NO_DNS=0:启用无线热点的DNS服务器。
NO_DNSMASQ=0:启用DNSMASQ服务。
HIDDEN=0:无线热点的SSID不隐藏。
MAC_FILTER=0:禁用MAC地址过滤。
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept:指定MAC地址过滤的白名单文件路径。
ISOLATE_CLIENTS=0:不隔离连接到无线热点的客户端之间的通信。
SHARE_METHOD=nat:使用NAT方式进行无线热点的Internet共享。
IEEE80211N=0:禁用802.11n标准。(2.4G)
IEEE80211AC=0:禁用802.11ac标准。(5G)
HT_CAPAB=[HT40+]:启用HT40+高级设置。
VHT_CAPAB=:未指定VHT_CAPAB。
DRIVER=nl80211:使用nl80211驱动程序。
NO_VIRT=0:启用虚拟无线接口。
COUNTRY=:未指定国家代码。
FREQ_BAND=2.4:设置频段为2.4GHz。
NEW_MACADDR=:未指定新的MAC地址。
DAEMONIZE=0:不将create_ap进程置于后台运行。
NO_HAVEGED=0:启用haveged服务。
WIFI_IFACE=wlp3s0:指定用于创建无线热点的无线网卡接口。
INTERNET_IFACE=enp1s0:指定用于连接到Internet的有线网卡接口。
SSID=0125:设置无线热点的SSID为0125。
PASSPHRASE=12345678:设置无线热点的密码为12345678。
USE_PSK=0:禁用预共享密钥(PSK)

2.关于信号强度和延时

2.1 信号强度

推荐测试信号强度的APP
在这里插入图片描述
在这里插入图片描述

2.2 信号延时

有时候明明信号强度很好,但延时却很高,可能是当前信道的网络较多。

要判断哪个信道不拥堵,可以考虑以下几个因素:

  • 信道的使用情况:观察每个信道的使用情况,特别是附近的WIFI网络和其他无线设备。如果某个信道上有多个网络同时使用,那么该信道可能会拥堵。相反,如果某个信道上没有或只有少数网络使用,那么该信道可能不拥堵。
  • 信道的干扰情况:除了WIFI网络,还要注意其他可能引起干扰的设备,如蓝牙设备、微波炉等。这些设备可能会占用特定的频段,导致信道拥堵。因此,选择一个与这些设备干扰较少的信道可能更好。
  • 信道的频率:不同信道的频率可能会有所不同。一般来说,较高频率的信道可能会有更高的带宽和速度,但在传输距离上可能较短(5G)。因此,如果你的设备距离WIFI路由器较近,可以考虑选择较高频率的信道。

综合考虑以上因素,你可以选择一个较少拥堵、干扰较少且适合你的设备的信道。在给定的信息中,你可以观察每个信道的频率和可能的干扰源,并根据这些信息来判断哪个信道可能不拥堵。

使用iwlist命令来列出无线网卡支持的所有信道:

sudo iwlist wlp3s0 channel
root@bossdog-2177018234:/etc# iwlist wlp3s0 channel
wlp3s0    32 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Channel 36 : 5.18 GHz
          Channel 40 : 5.2 GHz
          Channel 44 : 5.22 GHz
          Channel 48 : 5.24 GHz
          Channel 52 : 5.26 GHz
          Channel 56 : 5.28 GHz
          Channel 60 : 5.3 GHz
          Channel 64 : 5.32 GHz
          Channel 100 : 5.5 GHz
          Channel 104 : 5.52 GHz
          Channel 108 : 5.54 GHz
          Channel 112 : 5.56 GHz
          Channel 116 : 5.58 GHz
          Channel 120 : 5.6 GHz
          Channel 124 : 5.62 GHz
          Channel 128 : 5.64 GHz
          Channel 132 : 5.66 GHz
          Channel 136 : 5.68 GHz
          Channel 140 : 5.7 GHz

2.3 网络延时测试工具推荐——PingPlotter

https://blog.csdn.net/qq_45946755/article/details/104594683
关于工具的介绍:https://www.bilibili.com/video/BV1kx41117jt/?p=6&spm_id_from=333.1007.top_right_bar_window_history.content.click
在这里插入图片描述

3.确定当前网卡是否支持5G网络

iw reg get 

在这里插入图片描述

iw list
root@bossdog-2177018234:/etc# iw list
Wiphy phy0
	max # scan SSIDs: 20
	max scan IEs length: 425 bytes
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports RSN-IBSS.
	Device supports AP-side u-APSD.
	Device supports T-DLS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP (00-0f-ac:4)
		* CMAC (00-0f-ac:6)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * P2P-client
		 * P2P-GO
		 * P2P-device
	Band 1:
		Capabilities: 0x11ef
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT TX/RX MCS rate indexes supported: 0-15
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412 MHz [1] (22.0 dBm)
			* 2417 MHz [2] (22.0 dBm)
			* 2422 MHz [3] (22.0 dBm)
			* 2427 MHz [4] (22.0 dBm)
			* 2432 MHz [5] (22.0 dBm)
			* 2437 MHz [6] (22.0 dBm)
			* 2442 MHz [7] (22.0 dBm)
			* 2447 MHz [8] (22.0 dBm)
			* 2452 MHz [9] (22.0 dBm)
			* 2457 MHz [10] (22.0 dBm)
			* 2462 MHz [11] (22.0 dBm)
			* 2467 MHz [12] (22.0 dBm) (no IR)
			* 2472 MHz [13] (22.0 dBm) (no IR)
	Band 2:
		Capabilities: 0x11ef
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT TX/RX MCS rate indexes supported: 0-15
		VHT Capabilities (0x038071b0):
			Max MPDU length: 3895
			Supported Channel Width: neither 160 nor 80+80
			RX LDPC
			short GI (80 MHz)
			TX STBC
			SU Beamformee
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 0 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 0 Mbps
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180 MHz [36] (22.0 dBm) (no IR)
			* 5200 MHz [40] (22.0 dBm) (no IR)
			* 5220 MHz [44] (22.0 dBm) (no IR)
			* 5240 MHz [48] (22.0 dBm) (no IR)
			* 5260 MHz [52] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5280 MHz [56] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5300 MHz [60] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5320 MHz [64] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5500 MHz [100] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5520 MHz [104] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5540 MHz [108] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5560 MHz [112] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5580 MHz [116] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5600 MHz [120] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5620 MHz [124] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5640 MHz [128] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5660 MHz [132] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5680 MHz [136] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5700 MHz [140] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5720 MHz [144] (22.0 dBm) (no IR, radar detection)
			  DFS state: usable (for 2401 sec)
			  DFS CAC time: 0 ms
			* 5745 MHz [149] (22.0 dBm) (no IR)
			* 5765 MHz [153] (22.0 dBm) (no IR)
			* 5785 MHz [157] (22.0 dBm) (no IR)
			* 5805 MHz [161] (22.0 dBm) (no IR)
			* 5825 MHz [165] (22.0 dBm) (no IR)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * new_station
		 * new_mpath
		 * set_mesh_config
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * remain_on_channel
		 * set_tx_bitrate_mask
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * set_wds_peer
		 * tdls_mgmt
		 * tdls_oper
		 * start_sched_scan
		 * probe_client
		 * set_noack_map
		 * register_beacons
		 * start_p2p_device
		 * set_mcast_rate
		 * connect
		 * disconnect
		 * channel_switch
		 * Unknown command (104)
		 * Unknown command (105)
		 * Unknown command (121)
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xd0
	WoWLAN support:
		 * wake up on disconnect
		 * wake up on magic packet
		 * wake up on pattern match, up to 20 patterns of 16-128 bytes,
		   maximum packet offset 0 bytes
		 * can do GTK rekeying
		 * wake up on GTK rekey failure
		 * wake up on EAP identity request
		 * wake up on 4-way handshake
		 * wake up on rfkill release
		 * wake up on TCP connection
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	valid interface combinations:
		 * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
		   total <= 3, #channels <= 2
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.
	Device supports SAE with AUTHENTICATE command
	Device supports low priority scan.
	Device supports scan flush.
	Device supports per-vif TX power setting
	P2P GO supports CT window setting
	P2P GO supports opportunistic powersave setting
	Driver supports full state transitions for AP/GO clients
	Driver supports a userspace MPM
	Driver/device bandwidth changes during BSS lifetime (AP/GO mode)
	Device supports static SMPS
	Device supports dynamic SMPS

显示, (no IR, radar detection) 就是 这些5G 通道不可用

4.通过create_ap修改信道

修改create_ap.conf中的配置项

CHANNEL=8:无线热点的频道设置为信道8。
FREQ_BAND=2.4:设置频段为2.4GHz。
CHANNEL=36:无线热点的频道设置为信道36。
FREQ_BAND=5:设置频段为5GHz。

5.坑一:iw list显示 no IR

在这里插入图片描述
解决方法:修改国家代码

iw reg get  # 获取当前系统设置的国家代码
iw reg set CN # 设置国家代码为中国

Wifi 5GHz AP Mode: What does no IR means and can I bypass it?
https://superuser.com/questions/809282/wifi-5ghz-ap-mode-what-does-no-ir-means-and-can-i-bypass-it

iw reg get
iwlist wlp3s0 channel
lspci -nn | grep -i net

6.坑二:将5G频道设为首选

7.坑三:芯片支持5G,网卡不支持——打补丁

我的无线网卡型号:英特尔,双频带 Wireless-AC7265

8.坑四:驱动需要更新

驱动官网
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
在这里插入图片描述

https://www.intel.com/content/www/us/en/support/articles/000005511/wireless.html

PS:安装方法可以查看驱动包中的文档,以README.iwlwifi-7265-ucode为例

Installation of the firmware is simply:

        % cp iwlwifi-7265-14.ucode /lib/firmware
        % cp iwlwifi-7265D-14.ucode /lib/firmware

You can now load the driver (see the INSTALL and README.iwlwifi provided with
the iwlwifi package for information on building and using that driver.)

9.坑五:Linux下Intel无线网卡不支持5GHz AP频道?

https://www.zhihu.com/question/348965940

https://www.zhihu.com/question/389224239

https://iovxw.net/p/intel-5ghz-ap/

10.5G热点和5G自发ap?

  5G热点和5G自发ap不是完全相同的概念。
  5G热点是一种设备,通常是一个小型无线路由器,可以将5G网络信号转换为Wi-Fi信号,以便多个设备可以使用同一个5G网络连接。它可以通过移动网络运营商提供的5G数据计划来连接互联网,也可以通过Wi-Fi网络连接到互联网。
  5G自发ap是指设备本身就具备5G网络连接功能,可以直接通过5G网络连接到互联网,并可以通过Wi-Fi信号将网络连接分享给其他设备。这种设备通常是智能手机、平板电脑、笔记本电脑等移动设备,可以直接使用5G网络进行互联网连接。
  因此,两者的区别在于,5G热点是一个专门的设备,可以将5G网络转换为Wi-Fi信号,以便多个设备可以连接,而5G自发ap是指设备本身就具备5G网络连接功能,可以直接将网络连接分享给其他设备。

11.无线模块发射5g信号和5g的自发AP?

  无线模块发射5G信号是指该模块能够发送和接收5G网络的信号,但并不一定能够作为独立的接入点(AP)提供网络服务。
  5G的自发AP是指某些设备(如手机、路由器等)具有能力作为独立的接入点提供5G网络服务,类似于传统的Wi-Fi热点。
  因此,虽然两者都涉及5G网络信号的传输,但其功能和应用场景略有不同。

参考
https://blog.csdn.net/subfate/article/details/51882322
解决linux系统WIFI无法使用5GHz频率的问题