如何防止 Ubuntu 20.04 中随机 WiFi 连接断开?

如何防止 Ubuntu 20.04 中随机 WiFi 连接断开?

我在ThinkPad P72。更新到 20.04 后,WiFi 每天掉线几次,每小时掉线十几次,并且很难重新连接(如果我关闭 WiFi 然后再打开,它有时会重新连接),除非我重新启动。我的 WiFi 点不会对其他操作系统造成连接问题。

我听一位最近升级到 20.04 的朋友说,他们也遇到了 WiFi 随机连接中断的情况。

笔记:我不知道什么样的调试或日志文件或诊断在这里有用,但如果您在评论中要求具体信息,我会尽力提供。


编辑:这些断开连接事件根本不会显示出来/var/log/syslog

$ lspci -knn | grep Net -A3; rfkill list
00:14.3 Network controller [0280]: Intel Corporation Wireless-AC 9560 [Jefferson Peak] [8086:a370] (rev 10)
    Subsystem: Intel Corporation Wireless-AC 9560 [Jefferson Peak] [8086:0030]
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi
0: tpacpi_bluetooth_sw: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

将 2.4Ghz 设置为“自动”频道

% iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:2.417 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=48 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=57/70  Signal level=-53 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:382   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 5GHz 频段的第 36 频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:5.2 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=48 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=47/70  Signal level=-63 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:6   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 5GHz 频段的第 48 频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:5.24 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=54 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=51/70  Signal level=-59 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:13   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 5 GHz 频段的 149 频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:5.745 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=54 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=51/70  Signal level=-59 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:10   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到5GHz频段的161频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:5.805 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=54 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=54/70  Signal level=-56 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:1   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 2.4 GHz 频段的频道 1 后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=54 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=56/70  Signal level=-54 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:6   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 2.4 GHz 频段的第 6 频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=48 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=60/70  Signal level=-50 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:8   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.

切换到 2.4 GHz 频段的第 11 频道后:

$ iwconfig
wlp0s20f3  IEEE 802.11  ESSID:"R910a-2DB972"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: F4:63:49:2D:B9:72   
          Bit Rate=54 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=60/70  Signal level=-50 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:1   Missed beacon:0

lo        no wireless extensions.

enx5282d5c87b2f  no wireless extensions.

enp0s31f6  no wireless extensions.
$ iwlist wlp0s20f3 freq
wlp0s20f3  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
          Current Frequency:2.417 GHz (Channel 2)

答案1

我的笔记本电脑经常出现这个问题,大约半年后,我意识到 ubuntu 不能很好地处理某些 wifi 路由器信号。为我解决这个问题的方法是禁用 IPv6,并在路由器上只选择一个频道。(之前是动态的)。我在家里不再遇到问题。不幸的是,如果我在学校或咖啡馆,问题就会再次出现。

相关内容