类似这个问题:激活网络连接失败,但我遇到了以下问题。机器启动时会启动并连接到 wifi,但如果连接断开(出于任何原因),则连接不会重新启动并显示错误消息“激活网络连接失败”。我必须重新启动机器才能重新连接。如果我在第一次连接后尝试连接到其他网络,也会发生这种情况。
我尝试过的所有方法都无法解决这个问题,无论是手动尝试连接到 WiFi 网络,还是通过 systemctl 停止/重新启动网络管理器。
还有什么我可以尝试修复此问题,以便每次掉线时不需要重新启动?
我正在运行 Ubuntu 20.04,内核版本为 5.8.0-63-generic,因为我有一个 Realtek RTL8723DE wifi 适配器,并且没有更新的驱动程序(来自这里:https://github.com/lwfinger/rtw88)适用于更高版本的内核(请参阅我之前的问题:适用于 Linux 内核版本 5.11.0-26-generic(ubuntu 20.04)的 RTL8723DE 的 Realtek wifi 驱动程序)
请注意,我无法访问路由器进行有线连接,因此 Wi-Fi 是我唯一的连接选项。
编辑:根据以下评论,我添加了sudo journalctl -b 0 -u NetworkManager
输出https://pastebin.ubuntu.com/p/WgTt6KGyyj/,显示网络首次连接,然后在我关闭 wifi 并重新打开后连接失败,经历如下循环:
Jun 14 21:07:40 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237260.5736] sup-iface[0x56336ea5ba10,wlo1]: supports 5 scan SSIDs
Jun 14 21:07:40 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237260.5778] device (wlo1): supplicant interface state: starting -> ready
Jun 14 21:07:40 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237260.5780] device (p2p-dev-wlo1): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Jun 14 21:07:40 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237260.5828] device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.3582] policy: auto-activating connection 'Top Flat' (6a3647ab-a928-4d36-b895-e6a53f857391)
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.3595] device (wlo1): Activation: starting connection 'Top Flat' (6a3647ab-a928-4d36-b895-e6a53f857391)
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.3599] device (wlo1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.3610] manager: NetworkManager state is now CONNECTING
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.6724] device (wlo1): set-hw-addr: reset MAC address to A4:FC:77:7C:A3:0D (preserve)
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.6727] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.6731] device (wlo1): Activation: (wifi) access point 'Top Flat' has security, but secrets are required.
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.6731] device (wlo1): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7303] device (wlo1): supplicant interface state: ready -> disconnected
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7303] device (p2p-dev-wlo1): supplicant management interface state: ready -> disconnected
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7304] device (wlo1): supplicant interface state: disconnected -> inactive
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7305] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> inactive
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7327] device (wlo1): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7334] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7339] device (wlo1): Activation: (wifi) connection 'Top Flat' has security, and secrets exist. No new secrets needed.
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7340] Config: added 'ssid' value 'Top Flat'
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7340] Config: added 'scan_ssid' value '1'
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7341] Config: added 'bgscan' value 'simple:30:-65:300'
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7341] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK'
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7341] Config: added 'psk' value '<hidden>'
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7644] device (wlo1): supplicant interface state: inactive -> scanning
Jun 14 21:07:42 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237262.7645] device (p2p-dev-wlo1): supplicant management interface state: inactive -> scanning
Jun 14 21:07:44 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237264.4815] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:44 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237264.4823] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:44 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237264.5860] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:44 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237264.5862] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:45 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237265.9966] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:45 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237265.9966] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:46 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237266.0819] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:46 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237266.0821] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:47 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237267.4902] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:47 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237267.4910] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:47 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237267.9780] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:47 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237267.9782] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:49 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237269.3960] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:49 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237269.3961] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:49 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237269.8740] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:49 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237269.8742] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:51 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237271.2798] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:51 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237271.2798] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:52 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237272.2704] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:52 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237272.2705] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:53 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237273.6836] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:53 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237273.6843] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:07:54 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237274.6710] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:07:54 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237274.6712] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:07:56 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237276.0713] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:07:56 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237276.0713] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:08:01 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237281.3994] device (wlo1): supplicant interface state: disconnected -> scanning
Jun 14 21:08:01 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237281.3995] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
Jun 14 21:08:06 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237286.1046] device (wlo1): supplicant interface state: scanning -> disconnected
Jun 14 21:08:06 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237286.1046] device (p2p-dev-wlo1): supplicant management interface state: scanning -> disconnected
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <warn> [1655237287.6290] device (wlo1): Activation: (wifi) association took too long, failing activation
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237287.6291] device (wlo1): state change: config -> failed (reason 'ssid-not-found', sys-iface-state: 'managed')
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237287.6302] manager: NetworkManager state is now DISCONNECTED
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <warn> [1655237287.6390] device (wlo1): Activation: failed for connection 'Top Flat'
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237287.6494] device (wlo1): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jun 14 21:08:07 HP-Laptop-15-db0598sa NetworkManager[642]: <info> [1655237287.6666] device (wlo1): set-hw-addr: set MAC address to 4A:D0:E7:0C:83:44 (scanning)
编辑2:我还在 NetworkManager 中禁用了随机 MAC 切换,但这也没有解决问题
EDIT3:我已经使用针对此问题的脚本拍摄了wifi配置的快照:我的无线/WiFi 连接无法使用。诊断问题需要哪些信息?当 wifi 连接正常时以及当 wifi 连接不上时(并且无法重新连接)
工作/连接:https://pastebin.ubuntu.com/p/dTFptYhv8N/
不工作/未连接:https://pastebin.ubuntu.com/p/PPhHZNWcfd/
编辑4:我已经启动并重新启动到 5.13.0-48,它似乎更稳定,所以请关注!
答案1
我一直试图在我查看的所有帖子中发布此内容,但这里有一个可能有帮助的创可贴。最初的解题者获得了荣誉。 Wifi 不断掉线 - Ubuntu 20.04 和 Broadcom 无线适配器
答案2
正如上面的编辑(4)中提到的:我现在已经启动到 5.13.0-48,之前没有看到适配器,但现在似乎看到了,并且在我关闭/再次打开它之后连接又恢复了,所以它可能没有问题中的“激活网络连接失败”的问题。
如果在最新的内核版本中也出现这种情况,我会打开一个全新的 Q。