networkmanager wifi 未连接,wpa_supplicant 正常

networkmanager wifi 未连接,wpa_supplicant 正常

我正在尝试在一台计算机上设置接入点并从另一台计算机进行连接。以下是接入点配置 (/etc/NetworkManager/system-connections/Hotspot.nmconnection):

[connection]
id=Hotspot
uuid=590dd05e-61eb-41e0-aa4f-b838c5675d77
type=wifi
autoconnect=false
interface-name=wlan0
timestamp=1675612177

[wifi]
band=a
channel=149
mode=ap
ssid=MyAccessPoint_5G

[wifi-security]
auth-alg=open
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=SuperSecret

[ipv4]
method=shared

[ipv6]
addr-gen-mode=stable-privacy
method=ignore

[proxy]

此配置由

nmcli wifi hotspot ifname wlan0 ssid MyAccessPoint_5G password SuperSecret

在另一台电脑(笔记本)上,我尝试使用 nm-applet 连接此热点。它尝试了几秒钟但失败了,再次要求输入密码。

这是它在 (/etc/NetworkManager/system-connections/MyAccessPoint_5G.nmconnection) 创建的条目

[connection]
id=MyAccessPoint_5G
uuid=0a595f1c-925c-4904-861e-a96e21fbad24
type=wifi
interface-name=wlp5s0

[wifi]
mode=infrastructure
ssid=MyAccessPoint_5G

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=SuperSecret

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

[proxy]

以下是日志:

Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: CTRL-EVENT-SSID-REENABLED id=0 ssid="MyAcessPoing_5G"
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: SME: Trying to authenticate with a8:39:2f:50:86:b7 (SSID='MyAcessPoing_5G' freq=5745 MHz)
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: authenticate with a8:39:2f:50:86:b7
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: send auth to a8:39:2f:50:86:b7 (try 1/3)
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8143] device (wlp5s0): supplicant interface state: scanning -> authenticating
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8144] device (p2p-dev-wlp5s0): supplicant management interface state: scanning -> authenticating
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: Trying to associate with a8:39:2f:50:86:b7 (SSID='MyAcessPoing_5G' freq=5745 MHz)
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: authenticated
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: associate with a8:39:2f:50:86:b7 (try 1/3)
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8227] device (wlp5s0): supplicant interface state: authenticating -> associating
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8228] device (p2p-dev-wlp5s0): supplicant management interface state: authenticating -> associating
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: RX AssocResp from a8:39:2f:50:86:b7 (capab=0x8111 status=43 aid=0)
Feb 05 19:01:51 basilioe480 kernel: wlp5s0: a8:39:2f:50:86:b7 denied association (code=43)
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: CTRL-EVENT-ASSOC-REJECT bssid=a8:39:2f:50:86:b7 status_code=43
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: SME: Deauth request to the driver failed
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: BSSID a8:39:2f:50:86:b7 ignore list count incremented to 2, ignoring for 10 seconds
Feb 05 19:01:51 basilioe480 wpa_supplicant[1211]: wlp5s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyAcessPoing_5G" auth_failures=2 duration=20 reason=CONN_FAILED
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8710] device (wlp5s0): supplicant interface state: associating -> disconnected
Feb 05 19:01:51 basilioe480 NetworkManager[1173]: <info>  [1675612911.8711] device (p2p-dev-wlp5s0): supplicant management interface state: associating -> disconnected
Feb 05 19:01:53 basilioe480 dhclient[6958]: DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 3 (xid=0xe42bf937)
Feb 05 19:01:56 basilioe480 dhclient[6958]: DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 8 (xid=0xe42bf937)
Feb 05 19:02:01 basilioe480 NetworkManager[1173]: <info>  [1675612921.8739] device (wlp5s0): supplicant interface state: disconnected -> scanning
Feb 05 19:02:01 basilioe480 NetworkManager[1173]: <info>  [1675612921.8740] device (p2p-dev-wlp5s0): supplicant management interface state: disconnected -> scanning

我使用 wpa_passphrase 创建了一个简单的配置:

network={
    ssid="MyAccessPoint_5G"
    #psk="SuperSecret"
    psk=8c2193dd5c26d1ce18553fdd17e3b1a93af3650f5d1fecaabf7efe2f4c162122
}

当我手动启动 wpa_supplicant 时,它可以毫无问题地连接。

$ sudo wpa_supplicant -cmyap.conf -iwlp5s0

Successfully initialized wpa_supplicant
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: Could not set interface 'p2p-dev-wlp5s0' UP
nl80211: deinit ifname=p2p-dev-wlp5s0 disabled_11b_rates=0
p2p-dev-wlp5s0: Failed to initialize driver interface
p2p-dev-wlp5s0: CTRL-EVENT-DSCP-POLICY clear_all
P2P: Failed to enable P2P Device interface
wlp5s0: SME: Trying to authenticate with a8:39:2f:50:86:b7 (SSID='MyAccessPoint_5G' freq=5745 MHz)
wlp5s0: Trying to associate with a8:39:2f:50:86:b7 (SSID='MyAccessPoint_5G' freq=5745 MHz)
wlp5s0: Associated with a8:39:2f:50:86:b7
wlp5s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
wlp5s0: WPA: Key negotiation completed with a8:39:2f:50:86:b7 [PTK=CCMP GTK=CCMP]
wlp5s0: CTRL-EVENT-CONNECTED - Connection to a8:39:2f:50:86:b7 completed [id=0 id_str=]

接入点是 Orange Pi Zero 2(Allwinner H616 64 位高性能四核 Cortex-A53 处理器,AW859A 芯片支持 IEEE 802.11 a/b/g/n/ac),运行 Ubuntu 22.04.1 LTS(aarch64)

笔记本是 Thinkpad e480,无线网卡是 Intel Dual Band Wireless-AC 3165,运行 Ubuntu 22.04.1 LTS

答案1

一旦我将 proto 更改为 ,问题就解决了wpa。默认情况下,Hotspot 在创建时将 proto 设置为rsn

NetworkManager 配置中没有针对 proto 的设置,我从热点日志中找到了答案:

Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3346] Config: added 'ssid' value 'MyAccessPoint_5G'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3348] Config: added 'mode' value '2'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3349] Config: added 'frequency' value '5745'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3349] Config: added 'freq_list' value '5745'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3350] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3351] Config: added 'auth_alg' value 'OPEN'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3351] Config: added 'psk' value '<hidden>'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3352] Config: added 'proto' value 'RSN'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3353] Config: added 'pairwise' value 'CCMP'
Feb 07 15:10:52 bedroomap NetworkManager[641]: <info>  [1675782652.3354] Config: added 'group' value 'CCMP'

我已经添加了 proto wpa 并且一切正常:

# nmcli connection modify Hotspot 802-11-wireless-security.proto wpa

相关内容