为什么我在 Ubuntu 20.04.6 中会出现间歇性 Wi-Fi 断开连接的情况?

为什么我在 Ubuntu 20.04.6 中会出现间歇性 Wi-Fi 断开连接的情况?

我正在使用 Ubuntu 20.04.6,并且一直遇到间歇性 Wi-Fi 断开连接的情况,在此期间我的 Wi-Fi 图标变成问号。

在我的WIFI自动重新连接之前,我能够获得以下所有信息:

  • 输出ifconfig -a

    eno1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            ether ec:8e:b5:45:a7:27  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 96567  bytes 8206625 (8.2 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 96567  bytes 8206625 (8.2 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.0.20  netmask 255.255.255.0  broadcast 192.168.0.255
            inet6 2606:a800:cf85:1a00:76e6:5d29:86fc:8d7e  prefixlen 64  scopeid 0x0<global>
            inet6 fe80::20fc:fa07:8117:1c33  prefixlen 64  scopeid 0x20<link>
            inet6 2606:a800:cf85:1a00:c56d:f38c:137a:80e1  prefixlen 64  scopeid 0x0<global>       ether 40:49:0f:48:d6:94  txqueuelen 1000  (Ethernet)
            RX packets 1558979  bytes 1007454192 (1.0 GB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 918856  bytes 168900180 (168.9 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
  • 输出ping 192.168.0.1(这是我的路由器的 IP):

    PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
    From 192.168.0.20 icmp_seq=1 Destination Host Unreachable
    From 192.168.0.20 icmp_seq=2 Destination Host Unreachable
    From 192.168.0.20 icmp_seq=3 Destination Host Unreachable
    From 192.168.0.20 icmp_seq=4 Destination Host Unreachable
    ^C
    --- 192.168.0.1 ping statistics ---
    6 packets transmitted, 0 received, +4 errors, 100% packet loss, time 5065ms
    pipe 3
    
  • 输出service network-manager status

    ● NetworkManager.service - Network Manager
         Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
         Active: active (running) since Sat 2023-12-09 15:42:03 EST; 7h ago
           Docs: man:NetworkManager(8)
       Main PID: 799 (NetworkManager)
          Tasks: 3 (limit: 4485)
         Memory: 10.2M
         CGroup: /system.slice/NetworkManager.service
                 └─799 /usr/sbin/NetworkManager --no-daemon
    
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6390] dhcp4 (wlo1): option requested_rfc3442_classless_static_routes => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6390] dhcp4 (wlo1): option requested_root_path  => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6391] dhcp4 (wlo1): option requested_routers    => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6391] dhcp4 (wlo1): option requested_static_routes => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6392] dhcp4 (wlo1): option requested_subnet_mask => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6392] dhcp4 (wlo1): option requested_time_offset => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6392] dhcp4 (wlo1): option requested_wpad       => '1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6393] dhcp4 (wlo1): option routers              => '192.168.0.1'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6393] dhcp4 (wlo1): option subnet_mask          => '255.255.255.0'
    Dec 09 22:54:51 ubuntu20 NetworkManager[799]: <info>  [1702180491.6393] dhcp4 (wlo1): state changed extended -> extended
    
  • 输出iwconfig

    wlo1      IEEE 802.11  ESSID:"patawad"
              Mode:Managed  Frequency:2.437 GHz  Access Point: C0:C5:22:4C:9E:D0
              Bit Rate=54 Mb/s   Tx-Power=20 dBm
              Retry short limit:7   RTS thr=2347 B   Fragment thr:off
              Power Management:off
              Link Quality=64/70  Signal level=-46 dBm
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:4   Missed beacon:0
    
  • 输出nmcli dev wifi

    IN-USE  BSSID              SSID              MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
    *       C0:C5:22:4C:9E:D0  patawad           Infra  6     54 Mbit/s   100     ▂▄▆█  WPA1 WPA2
            94:18:65:49:D5:1B  skeetswifi_2GEXT  Infra  6     270 Mbit/s  67      ▂▄▆_  WPA2
            6C:AE:F6:C5:CC:64  9755a8            Mesh   6     270 Mbit/s  67      ▂▄▆_  WPA3
            6C:AE:F6:C5:CC:67  skeetswifi        Infra  6     270 Mbit/s  67      ▂▄▆_  WPA2
            6C:AE:F6:C5:CC:6A  --                Infra  6     270 Mbit/s  67      ▂▄▆_  --
    
  • 最后,12 月 09 日 21:22:35 发生故障之前的网络日志(<warn>):

    $ sudo journalctl -b 0 -u NetworkManager
    Dec 09 21:09:51 ubuntu20 NetworkManager[799]: <info>  [1702174191.6197] dhcp4 (wlo1): option routers              => '192.168.0.1'
    Dec 09 21:09:51 ubuntu20 NetworkManager[799]: <info>  [1702174191.6198] dhcp4 (wlo1): option subnet_mask          => '255.255.255.0'
    Dec 09 21:09:51 ubuntu20 NetworkManager[799]: <info>  [1702174191.6198] dhcp4 (wlo1): state changed extended -> extended
    Dec 09 21:22:35 ubuntu20 NetworkManager[799]: <warn>  [1702174955.9205] sup-iface[0x557d363c1920,wlo1]: connection disconnected (reason -4)
    Dec 09 21:22:35 ubuntu20 NetworkManager[799]: <info>  [1702174955.9537] device (wlo1): supplicant interface state: completed -> disconnected
    Dec 09 21:22:35 ubuntu20 NetworkManager[799]: <info>  [1702174955.9538] device (p2p-dev-wlo1): supplicant management interface state: completed -> disconnected
    Dec 09 21:22:36 ubuntu20 NetworkManager[799]: <info>  [1702174956.0225] device (wlo1): supplicant interface state: disconnected -> scanning
    Dec 09 21:22:36 ubuntu20 NetworkManager[799]: <info>  [1702174956.0228] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> scanning
    Dec 09 21:22:36 ubuntu20 NetworkManager[799]: <info>  [1702174956.9985] device (wlo1): supplicant interface state: scanning -> authenticating
    Dec 09 21:22:36 ubuntu20 NetworkManager[799]: <info>  [1702174956.9986] device (p2p-dev-wlo1): supplicant management interface state: scanning -> authenticating
    

为何我的 Wi-Fi 会断开连接?

答案1

根据输出的这一片段来判断iwconfig

wlo1      IEEE 802.11  ESSID:"patawad"
          Mode:Managed  Frequency:2.437 GHz  Access Point: C0:C5:22:4C:9E:D0
          Bit Rate=54 Mb/s   Tx-Power=20 dBm

看来你正在运行 2.4GHz、54Mb/s,这相当于IEEE 802.11g-2003(WiFi 3)

这个标准已经有 20 年的历史了,出于安全和性能原因,我强烈建议您将 WiFi 接入点升级到至少 WiFi 5 或 6,这将更好地适用于包括 Ubuntu 在内的现代系统。

相关内容