在使用hostapd设置网卡热点时出现问题:
~$ sudo systemctl status hostapd
○ hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; preset: enabled)
Active: inactive (dead) since Mon 2026-06-22 22:44:11 CST; 9min ago
Duration: 5.055s
Docs: man:hostapd(8)
Process: 1314 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
Main PID: 1346 (code=exited, status=0/SUCCESS)
CPU: 6ms
Jun 22 22:44:06 mazy systemd[1]: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
Jun 22 22:44:06 mazy hostapd[1314]: wlp1s0: interface state UNINITIALIZED->COUNTRY_UPDATE
Jun 22 22:44:06 mazy systemd[1]: Started hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.
Jun 22 22:44:11 mazy hostapd[1346]: wlp1s0: IEEE 802.11 Configured channel (149) or frequency (5745) (secondary_channel=1) not found from the channel list of the current mode (2) IEEE 802.11a
Jun 22 22:44:11 mazy hostapd[1346]: wlp1s0: IEEE 802.11 Hardware does not support configured channel
Jun 22 22:44:11 mazy systemd[1]: hostapd.service: Deactivated successfully.
经检查发现原因为内核不支持iw设置地区:
~$ sudo iw reg get
global
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
~$ sudo iw reg get
global
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
查看内核日志可以发现:
~$ sudo dmesg |grep cfg80211
[ 4.726033] mei_me 0000:00:16.0: enabling device (0004 -> 0006)
[ 4.801485] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 4.801654] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 4.803728] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 4.804838] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
在更换内核为debian源的内核后上述情况消失。
当前机器内核:
Linux mazy 6.18.18-trim #570 SMP PREEMPT_DYNAMIC Fri May 8 07:07:34 UTC 2026 x86_64 GNU/Linux