熱點網路創建耗時過長,啟動失敗
我打算在我的筆記型電腦上使用 Arch Linux 上的 NetworkManager 託管一個熱點。創建熱點配置並不難。但是,當我嘗試啟動創建的熱點連接時,發生了錯誤。
Error: Connection activation failed: 802.1X supplicant took too long to authenticate Hint: use 'journalctl -xe NM_CONNECTION=b9ecc651-d491-414d-9c26-a3800cf2c9fd + NM_DEVICE=wlp3s0' to get more details.
我找到了它建議檢查的期刊,並將其粘貼在以下內容中:
-- Logs begin at Sat 2019-10-12 06:59:32 UTC, end at Sat 2020-09-26 23:29:53 UTC. -- Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.0692] device (wlp3s0): set-hw-addr: set MAC address to D2:D0:FE:25:82:24 (scanning) Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1337] device (wlp3s0): Activation: starting connection 'Hotspot' (b9ecc651-d491-414d-9c26-a3800cf2c9fd) Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1349] device (wlp3s0): supplicant interface state: completed -> disconnected Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1526] device (wlp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1611] device (wlp3s0): set-hw-addr: set-cloned MAC address to 7C:7A:91:3D:C5:ED (stable) Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1639] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1643] device (wlp3s0): Activation: (wifi) access point 'Hotspot' has security, but secrets are required. Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1643] device (wlp3s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1749] device (wlp3s0): supplicant interface state: disconnected -> interface_disabled Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1769] device (wlp3s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1781] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1785] device (wlp3s0): Activation: (wifi) connection 'Hotspot' has security, and secrets exist. No new secrets needed. Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info> [1601162963.1817] device (wlp3s0): supplicant interface state: interface_disabled -> disconnected Sep 26 23:29:48 ArchPad NetworkManager[1201]: <warn> [1601162988.5177] device (wlp3s0): Activation: (wifi) Hotspot network creation took too long, failing activation Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info> [1601162988.5178] device (wlp3s0): state change: config -> failed (reason 'supplicant-timeout', sys-iface-state: 'managed') Sep 26 23:29:48 ArchPad NetworkManager[1201]: <warn> [1601162988.5199] device (wlp3s0): Activation: failed for connection 'Hotspot' Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info> [1601162988.5215] device (wlp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed') Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info> [1601162988.5263] device (wlp3s0): set-hw-addr: set MAC address to 6E:7F:89:23:28:29 (scanning)
似乎 wpa_supplicant 需要花費太多時間來設置熱點。我檢查了熱點連接的配置,我認為沒有任何與 supplicant-timeout 相關的內容:
connection.id: Hotspot connection.uuid: b9ecc651-d491-414d-9c26-a3800cf2c9fd connection.stable-id: -- connection.type: 802-11-wireless connection.interface-name: wlp3s0 connection.autoconnect: no connection.autoconnect-priority: 0 connection.autoconnect-retries: -1 (default) connection.multi-connect: 0 (default) connection.auth-retries: -1 connection.timestamp: 0 connection.read-only: no connection.permissions: -- connection.zone: -- connection.master: -- connection.slave-type: -- connection.autoconnect-slaves: -1 (default) connection.secondaries: -- connection.gateway-ping-timeout: 0 connection.metered: unknown connection.lldp: default connection.mdns: -1 (default) connection.llmnr: -1 (default) connection.wait-device-timeout: -1 802-11-wireless.ssid: TP-Link 802-11-wireless.mode: ap 802-11-wireless.band: a 802-11-wireless.channel: 7 802-11-wireless.bssid: -- 802-11-wireless.rate: 0 802-11-wireless.tx-power: 0 802-11-wireless.mac-address: -- 802-11-wireless.cloned-mac-address: stable 802-11-wireless.generate-mac-address-mask:FE:FF:FF:00:00:00 802-11-wireless.mac-address-blacklist: -- 802-11-wireless.mac-address-randomization:default 802-11-wireless.mtu: auto 802-11-wireless.seen-bssids: -- 802-11-wireless.hidden: no 802-11-wireless.powersave: 0 (default) 802-11-wireless.wake-on-wlan: 0x1 (default) 802-11-wireless-security.key-mgmt: wpa-psk 802-11-wireless-security.wep-tx-keyidx: 0 802-11-wireless-security.auth-alg: -- 802-11-wireless-security.proto: rsn 802-11-wireless-security.pairwise: ccmp 802-11-wireless-security.group: ccmp 802-11-wireless-security.pmf: 0 (default) 802-11-wireless-security.leap-username: -- 802-11-wireless-security.wep-key0: <hidden> 802-11-wireless-security.wep-key1: <hidden> 802-11-wireless-security.wep-key2: <hidden> 802-11-wireless-security.wep-key3: <hidden> 802-11-wireless-security.wep-key-flags: 0 (none) 802-11-wireless-security.wep-key-type: unknown 802-11-wireless-security.psk: <hidden> 802-11-wireless-security.psk-flags: 0 (none) 802-11-wireless-security.leap-password: <hidden> 802-11-wireless-security.leap-password-flags:0 (none) 802-11-wireless-security.wps-method: 0x0 (default) 802-11-wireless-security.fils: 0 (default) ipv4.method: shared ipv4.dns: -- ipv4.dns-search: -- ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- ipv4.routes: -- ipv4.route-metric: -1 ipv4.route-table: 0 (unspec) ipv4.routing-rules: -- ipv4.ignore-auto-routes: no ipv4.ignore-auto-dns: no ipv4.dhcp-client-id: -- ipv4.dhcp-iaid: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname: yes ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) ipv4.never-default: no ipv4.may-fail: yes ipv4.dad-timeout: -1 (default) ipv6.method: ignore ipv6.dns: -- ipv6.dns-search: -- ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- ipv6.routes: -- ipv6.route-metric: -1 ipv6.route-table: 0 (unspec) ipv6.routing-rules: -- ipv6.ignore-auto-routes: no ipv6.ignore-auto-dns: no ipv6.never-default: no ipv6.may-fail: yes ipv6.ip6-privacy: -1 (unknown) ipv6.addr-gen-mode: stable-privacy ipv6.ra-timeout: 0 (default) ipv6.dhcp-duid: -- ipv6.dhcp-iaid: -- ipv6.dhcp-timeout: 0 (default) ipv6.dhcp-send-hostname: yes ipv6.dhcp-hostname: -- ipv6.dhcp-hostname-flags: 0x0 (none) ipv6.token: -- proxy.method: none proxy.browser-only: no proxy.pac-url: -- proxy.pac-script: --
另外,我在筆記型電腦上的無線網卡型號是 Intel Wireless-AC 7260,我認為它能夠託管熱點。有人對這個問題有任何想法嗎?
更新
802-11-wireless.channel
:更改為適當的值後,以下日誌仍然存在問題-- Journal begins at Mon 2020-12-14 23:36:12 UTC, ends at Fri 2021-01-29 00:07:08 UTC. -- Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3131] device (wlp3s0): Activation: starting connection 'Hotspot' (1b0ceabe-4f67-4b5a-8e09-6924744535d4) Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3134] device (wlp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3527] device (wlp3s0): set-hw-addr: reset MAC address to 7C:7A:91:A2:BB:B5 (preserve) Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3564] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3573] device (wlp3s0): Activation: (wifi) access point 'Hotspot' has security, but secrets are required. Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3575] device (wlp3s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3598] device (wlp3s0): supplicant interface state: inactive -> interface_disabled Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3632] device (wlp3s0): supplicant interface state: interface_disabled -> inactive Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3649] device (wlp3s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3675] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3679] device (wlp3s0): Activation: (wifi) connection 'Hotspot' has security, and secrets exist. No new secrets needed. Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info> [1611878705.3911] device (wlp3s0): supplicant interface state: inactive -> disconnected Jan 29 00:05:30 ArchPad NetworkManager[1175]: <warn> [1611878730.5137] device (wlp3s0): Activation: (wifi) Hotspot network creation took too long, failing activation Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info> [1611878730.5138] device (wlp3s0): state change: config -> failed (reason 'supplicant-timeout', sys-iface-state: 'managed') Jan 29 00:05:30 ArchPad NetworkManager[1175]: <warn> [1611878730.5159] device (wlp3s0): Activation: failed for connection 'Hotspot' Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info> [1611878730.5163] device (wlp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed') Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info> [1611878730.5230] device (wlp3s0): set-hw-addr: set MAC address to B6:1B:A6:1C:81:BD (scanning) Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info> [1611878730.5280] device (wlp3s0): supplicant interface state: disconnected -> inactive
我也在 Ubuntu 21.10 上遇到了這個問題:
>nmcli connection up bridge-slave-wlp4s0 Error: Connection activation failed: 802.1X supplicant took too long to authenticate
唯一有幫助的就是打開
wpa_supplicant
.>wpa_cli -i wlp4s0 log_level debug OK
之後,您將開始看到
debug
登錄journalctl -f
。現在,過濾和跟踪日誌:journalctl -f -u wpa_supplicant -u NetworkManager -u systemd-networkd
保持打開狀態,在另一個會話中,嘗試啟動您的連接。
就我而言,原來是與頻道相關的各種問題,例如,甚至在另一個答案中建議的頻道 120:
wpa_supplicant[1030]: Channel 120 (primary) not allowed for AP mode, flags: 0x17b NO-IR RADAR wpa_supplicant[1030]: hostapd_logger: Configured channel (120) not found from the channel list of current mode (2) IEEE 802.11a wpa_supplicant[1030]: hostapd_logger: Hardware does not support configured channel
您必須記住,有效渠道取決於許多因素,包括您所在的國家/地區:
iw reg get
就我而言,我有兩個條目:
global country 00: DFS-UNSET (2402 - 2472 @ 40), (N/A, 20), (N/A) ... phy#0 (self-managed) country CA: DFS-UNSET (2402 - 2437 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-80MHZ, NO-160MHZ ...
我使用以下命令將全域固定到我的國家:
iw reg set CA
您將獲得一組適用於您所在地區的頻率,您可以與https://en.wikipedia.org/wiki/List_of_WLAN_channels交叉引用以找到等效的頻道。
現在 - 這還不是我的全部。即使是報告有效的通道,如 42,最終也會失敗:
wpa_supplicant[1030]: nl80211: Set freq 5210 (ht_enabled=0, vht_enabled=0, he_enabled=0, bandwidth=0 MHz, cf1=0 MHz, cf2=0 MHz) wpa_supplicant[1030]: * freq=5210 wpa_supplicant[1030]: * he_enabled=0 wpa_supplicant[1030]: * vht_enabled=0 wpa_supplicant[1030]: * ht_enabled=0 wpa_supplicant[1030]: * channel_type=0 wpa_supplicant[1030]: nl80211: kernel reports: Channel is disabled wpa_supplicant[1030]: nl80211: Failed to set channel (freq=5210): -22 (Invalid argument)
(導致後來出現可怕的“熱點網路創建時間過長”)
事實證明,即使正確地
iw reg get
猜測了我的區域,也沒有設置以下文件:> cat /etc/default/crda # Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set # the initial regulatory domain setting for IEEE 802.11 devices which operate # on this system. # # Governments assert the right to regulate usage of radio spectrum within # their respective territories so make sure you select a ISO/IEC 3166-1 alpha2 # country code suitable for your location or you may infringe on local # legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone # descriptions containing ISO/IEC 3166-1 alpha2 country codes. REGDOMAIN=
就我而言,我調整
REGDOMAIN=CA
併重新啟動還是失敗了。
最後,我從日誌中註意到了這個調試條目:
wpa_supplicant[1029]: P2P: Add operating class 81 wpa_supplicant[1029]: P2P: Channels - hexdump(len=13): 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d wpa_supplicant[1029]: P2P: Add operating class 124 wpa_supplicant[1029]: P2P: Channels - hexdump(len=4): 95 99 9d a1 wpa_supplicant[1029]: P2P: Add operating class 125 wpa_supplicant[1029]: P2P: Channels - hexdump(len=5): 95 99 9d a1 a5 wpa_supplicant[1029]: P2P: Add operating class 126 wpa_supplicant[1029]: P2P: Channels - hexdump(len=2): 95 9d wpa_supplicant[1029]: P2P: Add operating class 127 wpa_supplicant[1029]: P2P: Channels - hexdump(len=2): 99 a1 wpa_supplicant[1029]: P2P: Update channel list wpa_supplicant[1029]: P2P: channels: 81:1,2,3,4,5,6,7,8,9,10,11,12,13 124:149,153,157,161 125:149,153,157,161,165 126:149,157 127:153,161
所以我嘗試了列出的渠道之一:
>nmcli connection modify bridge-slave-wlp4s0 wifi.channel 161 >nmcli connection up bridge-slave-wlp4s0 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/19)
它立即起作用。
所以仍然不知道為什麼我的某些頻道受到限制,但是查看將 wpa 日誌設置為調試的 journalctl,您應該能夠找到工作頻道的列表。
$$ EDIT $$搜尋了一下,找到了部分頻道不可用的原因。我的英特爾卡不支持任何非 20Mhz 頻段。 這列出了僅在客戶端模式下支持的通道:
>iw phy phy0 info | grep "no IR" phy phy0 info | grep "no IR" * 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) * 5280 MHz [56] (22.0 dBm) (no IR, radar detection) * 5300 MHz [60] (22.0 dBm) (no IR, radar detection) * 5320 MHz [64] (22.0 dBm) (no IR, radar detection) * 5500 MHz [100] (22.0 dBm) (no IR, radar detection) * 5520 MHz [104] (22.0 dBm) (no IR, radar detection) * 5540 MHz [108] (22.0 dBm) (no IR, radar detection) * 5560 MHz [112] (22.0 dBm) (no IR, radar detection) * 5580 MHz [116] (22.0 dBm) (no IR, radar detection) * 5600 MHz [120] (22.0 dBm) (no IR, radar detection) * 5620 MHz [124] (22.0 dBm) (no IR, radar detection) * 5640 MHz [128] (22.0 dBm) (no IR, radar detection) * 5660 MHz [132] (22.0 dBm) (no IR, radar detection) * 5680 MHz [136] (22.0 dBm) (no IR, radar detection) * 5700 MHz [140] (22.0 dBm) (no IR, radar detection) * 5720 MHz [144] (22.0 dBm) (no IR, radar detection)
該列表中的其他頻道將顯示為
disabled
- 所以最後,這就是我用來列出可用頻道的內容:iw phy phy0 info | grep "MHz \[" | grep -v "no IR" | grep -v "disabled" * 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) * 2472 MHz [13] (22.0 dBm) * 5745 MHz [149] (22.0 dBm) * 5765 MHz [153] (22.0 dBm) * 5785 MHz [157] (22.0 dBm) * 5805 MHz [161] (22.0 dBm) * 5825 MHz [165] (22.0 dBm)