NetworkManager 不断连接和断开连接。我怎样才能解决这个问题?

NetworkManager 不断连接和断开连接。我怎样才能解决这个问题?

我正在使用最新的可用版本和最新系统,如下:Arch kernel 5.6.4-arch1-1、Openbox 3.6.1、NetworkManager 1.24.0-1、wpa_supplicant v2.9。

我在三个地理位置使用笔记本电脑。每个位置都有一个独特的 wifi 网络,我可以连接到它自己独特的 SSID。笔记本电脑仅使用WPA and WPA2 Personal协议在所有这三个位置进行连接。

在这三个地点中的两个地点,我的笔记本电脑 WiFi 总是能够快速、无缝、完美地连接,没有任何问题。

在第三个位置,并且仅在第三个位置,我的笔记本电脑不断地循环通过 WiFi 断开连接并每 10 秒重新连接一次,如以下步骤所述

  1. 5秒,搜索网络
  2. 1秒,连接到网络
  3. 4秒,断开连接
  4. 转到1并重新开始...

我能够在第三个位置获得互联网的网络连接,如上面列表中所述,但大约每 10 秒就有一次。

这使得在第三个地点工作变得不可能。

在第三个位置,路由器为所有其他设备提供完美的 WiFi。所以看来路由器并不是问题所在。

nm-applet我已经无数次尝试使用GUI 上的 GUI删除第三个位置的网络管理器连接配置文件tint2 taskbar,然后使用正确的密码等再次重新连接到第三个位置 SSID。但是这样做对问题没有任何改变。

sudo killall -STOP NetworkManager 我在上面的步骤 2 的一半左右一直在使用此命令行 ,以成功停止循环并保持连接,但这已停止工作。

现在我将以太网线插入笔记本电脑,并且笔记本电脑侧面的笔记本电脑 WiFi 物理开关已关闭。它通过附带的以太网电缆连接到互联网,但每 10 秒就有 5 秒失去连接。换句话说,它会循环打开和关闭连接,就像 WiFi 一样。同样,这也只发生在第三个位置。连接后,我会在连接建立后再次使用 sudo killall -STOP NetworkManager 以停止循环。

这似乎与第三个位置的笔记本电脑 wifi 配置有关。

添加:我在系统连接/断开连接时从系统日志添加了一个输出周期,如下

命令journalctl -ef产生此输出。

network is down. This is the end of last connection / disconnection cycle and the beginning of the next

May 23 13:46:52 t430 dhcpcd[5050]: ps_bpf_recvbpf: Network is down

preamble

May 23 13:46:52 t430 kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
May 23 13:46:52 t430 kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0

registering ipv4 address

May 23 13:46:52 t430 avahi-daemon[451]: Joining mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:46:52 t430 avahi-daemon[451]: New relevant interface wlp3s0.IPv4 for mDNS.
May 23 13:46:52 t430 avahi-daemon[451]: Registering new address record for 192.168.1.106 on wlp3s0.IPv4.

withdrawing ipv4 address

May 23 13:46:52 t430 avahi-daemon[451]: Withdrawing address record for 192.168.1.106 on wlp3s0.
May 23 13:46:52 t430 avahi-daemon[451]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:46:52 t430 avahi-daemon[451]: Interface wlp3s0.IPv4 no longer relevant for mDNS.
May 23 13:46:52 t430 dhcpcd[492]: wlp3s0: deleting route to 192.168.1.0/24
May 23 13:46:52 t430 dhcpcd[492]: wlp3s0: deleting default route via 192.168.1.1
May 23 13:46:52 t430 NetworkManager[454]: <warn>  [1590238012.8707] device (wlp3s0): Activation: failed for connection 'datastream5'

registering ipv4 address again

May 23 13:46:52 t430 avahi-daemon[451]: Joining mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:46:52 t430 wpa_supplicant[570]: wlp3s0: Reject scan trigger since one is already pending
May 23 13:46:52 t430 NetworkManager[454]: <info>  [1590238012.8775] device (wlp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')

May 23 13:46:52 t430 avahi-daemon[451]: New relevant interface wlp3s0.IPv4 for mDNS.
May 23 13:46:52 t430 avahi-daemon[451]: Registering new address record for 192.168.1.106 on wlp3s0.IPv4.
May 23 13:46:52 t430 NetworkManager[454]: <info>  [1590238012.8778] dhcp4 (wlp3s0): canceled DHCP transaction
May 23 13:46:52 t430 wpa_supplicant[570]: wlp3s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
May 23 13:46:52 t430 NetworkManager[454]: <info>  [1590238012.8778] dhcp4 (wlp3s0): state changed bound -> done

registering ipv6 address

May 23 13:46:52 t430 avahi-daemon[451]: Joining mDNS multicast group on interface wlp3s0.IPv6 with address fe80::fd81:7780:6410:e759.
May 23 13:46:52 t430 avahi-daemon[451]: New relevant interface wlp3s0.IPv6 for mDNS.
May 23 13:46:52 t430 avahi-daemon[451]: Registering new address record for fe80::fd81:7780:6410:e759 on wlp3s0.*.

May 23 13:46:52 t430 avahi-daemon[451]: Withdrawing address record for fe80::fd81:7780:6410:e759 on wlp3s0.
May 23 13:46:52 t430 NetworkManager[454]: <info>  [1590238012.8822] device (wlp3s0): supplicant interface state: completed -> scanning
May 23 13:46:52 t430 avahi-daemon[451]: Leaving mDNS multicast group on interface wlp3s0.IPv6 with address fe80::fd81:7780:6410:e759.
May 23 13:46:52 t430 avahi-daemon[451]: Interface wlp3s0.IPv6 no longer relevant for mDNS.

`withdrawing ipv4 address`
May 23 13:46:52 t430 avahi-daemon[451]: Withdrawing address record for 192.168.1.106 on wlp3s0.
May 23 13:46:52 t430 avahi-daemon[451]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:46:52 t430 avahi-daemon[451]: Interface wlp3s0.IPv4 no longer relevant for mDNS.

new ipv4 mac address

May 23 13:46:52 t430 dhcpcd[492]: wlp3s0: new hardware address: ca:b3:01:7c:20:73

disconnected

May 23 13:46:56 t430 NetworkManager[454]: <info>  [1590238016.0852] device (wlp3s0): supplicant interface state: scanning -> disconnected

NetworkManager succeeds at something

May 23 13:47:00 t430 systemd[1]: NetworkManager-dispatcher.service: Succeeded.
May 23 13:47:00 t430 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

May 23 13:47:00 t430 kernel: audit: type=1131 audit(1590238020.888:153): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.4312] policy: auto-activating connection 'datastream5' (4c200721-a84a-4619-9d08-319531f8c338)
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.4322] device (wlp3s0): Activation: starting connection 'datastream5' (4c200721-a84a-4619-9d08-319531f8c338)
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.4324] device (wlp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.4335] manager: NetworkManager state is now CONNECTING

May 23 13:47:02 t430 dhcpcd[492]: wlp3s0: new hardware address: 6c:88:14:62:84:3c
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.4486] device (wlp3s0): set-hw-addr: reset MAC address to 6C:88:14:62:84:3C (preserve)

scanning for connection

May 23 13:47:02 t430 kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
May 23 13:47:02 t430 kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0

May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8441] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8450] device (wlp3s0): Activation: (wifi) access point 'datastream5' has security, but secrets are required.
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8451] device (wlp3s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8491] device (wlp3s0): supplicant interface state: disconnected -> interface_disabled
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8512] device (wlp3s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8519] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8525] device (wlp3s0): Activation: (wifi) connection 'datastream5' has security, and secrets exist.  No new secrets needed.
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8526] Config: added 'ssid' value 'datastream5'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8526] Config: added 'scan_ssid' value '1'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8526] Config: added 'bgscan' value 'simple:30:-70:86400'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8527] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8527] Config: added 'auth_alg' value 'OPEN'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8527] Config: added 'psk' value '<hidden>'
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8794] device (wlp3s0): supplicant interface state: interface_disabled -> inactive
May 23 13:47:02 t430 NetworkManager[454]: <info>  [1590238022.8920] device (wlp3s0): supplicant interface state: inactive -> scanning
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: SME: Trying to authenticate with 70:4f:57:97:52:06 (SSID='datastream5' freq=2447 MHz)
May 23 13:47:06 t430 kernel: wlp3s0: authenticate with 70:4f:57:97:52:06
May 23 13:47:06 t430 kernel: wlp3s0: send auth to 70:4f:57:97:52:06 (try 1/3)
May 23 13:47:06 t430 kernel: wlp3s0: authenticated
May 23 13:47:06 t430 kernel: wlp3s0: associate with 70:4f:57:97:52:06 (try 1/3)
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1197] device (wlp3s0): supplicant interface state: scanning -> authenticating
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: Trying to associate with 70:4f:57:97:52:06 (SSID='datastream5' freq=2447 MHz)
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1226] device (wlp3s0): supplicant interface state: authenticating -> associating
May 23 13:47:06 t430 kernel: wlp3s0: RX AssocResp from 70:4f:57:97:52:06 (capab=0x1011 status=0 aid=3)
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: Associated with 70:4f:57:97:52:06
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
May 23 13:47:06 t430 kernel: wlp3s0: associated
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1533] device (wlp3s0): supplicant interface state: associating -> 4way_handshake
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: WPA: Key negotiation completed with 70:4f:57:97:52:06 [PTK=CCMP GTK=TKIP]
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: CTRL-EVENT-CONNECTED - Connection to 70:4f:57:97:52:06 completed [id=0 id_str=]
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: carrier acquired
May 23 13:47:06 t430 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1680] device (wlp3s0): supplicant interface state: 4way_handshake -> completed

#########################################################################################################

May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1681] device (wlp3s0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "datastream5"


May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1683] device (wlp3s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1688] dhcp4 (wlp3s0): activation: beginning transaction (timeout in 45 seconds)
May 23 13:47:06 t430 avahi-daemon[451]: Joining mDNS multicast group on interface wlp3s0.IPv6 with address fe80::fd81:7780:6410:e759.
May 23 13:47:06 t430 avahi-daemon[451]: New relevant interface wlp3s0.IPv6 for mDNS.
May 23 13:47:06 t430 avahi-daemon[451]: Registering new address record for fe80::fd81:7780:6410:e759 on wlp3s0.*.
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: IAID 14:62:84:3c
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: adding address fe80::c685:c3d0:8b05:a9e5
May 23 13:47:06 t430 avahi-daemon[451]: Registering new address record for fe80::c685:c3d0:8b05:a9e5 on wlp3s0.*.
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1957] dhcp4 (wlp3s0): option dhcp_lease_time      => '86400'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option domain_name_servers  => '192.168.1.1 0.0.0.0'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option expiry               => '1590324426'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option ip_address           => '192.168.1.106'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option requested_broadcast_address => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option requested_domain_name => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option requested_domain_name_servers => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option requested_domain_search => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1958] dhcp4 (wlp3s0): option requested_host_name  => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_interface_mtu => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_ms_classless_static_routes => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_nis_domain => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_nis_servers => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_ntp_servers => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_rfc3442_classless_static_routes => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_root_path  => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1959] dhcp4 (wlp3s0): option requested_routers    => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option requested_static_routes => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option requested_subnet_mask => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option requested_time_offset => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option requested_wpad       => '1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option routers              => '192.168.1.1'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): option subnet_mask          => '255.255.255.0'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1960] dhcp4 (wlp3s0): state changed unknown -> bound
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.1975] device (wlp3s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
May 23 13:47:06 t430 avahi-daemon[451]: Joining mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:47:06 t430 avahi-daemon[451]: New relevant interface wlp3s0.IPv4 for mDNS.
May 23 13:47:06 t430 avahi-daemon[451]: Registering new address record for 192.168.1.106 on wlp3s0.IPv4.
May 23 13:47:06 t430 dbus-daemon[453]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.13' (uid=0 pid=454 comm="/usr/bin/NetworkManager --no-daemon ")
May 23 13:47:06 t430 systemd[1]: Condition check resulted in First Boot Wizard being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Rebuild Dynamic Linker Cache being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Store a System Token in an EFI Variable being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Rebuild Journal Catalog being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Commit a transient machine-id on disk being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Create System Users being skipped.
May 23 13:47:06 t430 systemd[1]: Condition check resulted in Update is Completed being skipped.
May 23 13:47:06 t430 systemd[1]: Starting Network Manager Script Dispatcher Service...
May 23 13:47:06 t430 dbus-daemon[453]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
May 23 13:47:06 t430 systemd[1]: Started Network Manager Script Dispatcher Service.
May 23 13:47:06 t430 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2125] device (wlp3s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2128] device (wlp3s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2132] manager: NetworkManager state is now CONNECTED_LOCAL
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2143] manager: NetworkManager state is now CONNECTED_SITE
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2145] policy: set 'datastream5' (wlp3s0) as default for IPv4 routing and DNS
May 23 13:47:06 t430 kernel: audit: type=1130 audit(1590238026.208:154): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 23 13:47:06 t430 dunst[1185]: WARNING: No icon found in path: 'nm-signal-75'
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.2232] device (wlp3s0): Activation: successful, device activated.
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: rebinding lease of 192.168.1.106
May 23 13:47:06 t430 NetworkManager[454]: <info>  [1590238026.3305] manager: NetworkManager state is now CONNECTED_GLOBAL
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: leased 192.168.1.106 for 86400 seconds
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: adding route to 192.168.1.0/24
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: adding default route via 192.168.1.1
May 23 13:47:06 t430 systemd[1]: systemd-hostnamed.service: Succeeded.
May 23 13:47:06 t430 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 23 13:47:06 t430 kernel: audit: type=1131 audit(1590238026.351:155): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 23 13:47:06 t430 audit: AUDIT1334 prog-id=19 op=UNLOAD
May 23 13:47:06 t430 audit: AUDIT1334 prog-id=18 op=UNLOAD
May 23 13:47:06 t430 kernel: audit: type=1334 audit(1590238026.391:156): prog-id=19 op=UNLOAD
May 23 13:47:06 t430 kernel: audit: type=1334 audit(1590238026.391:157): prog-id=18 op=UNLOAD
May 23 13:47:06 t430 wpa_supplicant[570]: wlp3s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-60 noise=9999 txrate=13000
May 23 13:47:06 t430 dhcpcd[492]: wlp3s0: soliciting an IPv6 router
May 23 13:47:08 t430 dhcpcd[492]: wlp3s0: Router Advertisement from fe80::724f:57ff:fe97:5206
May 23 13:47:08 t430 NetworkManager[454]: <info>  [1590238028.0508] dhcp6 (wlp3s0): activation: beginning transaction (timeout in 45 seconds)
May 23 13:47:08 t430 NetworkManager[454]: <warn>  [1590238028.0510] device (wlp3s0): failure to start DHCPv6: failed to start client: Address already in use
May 23 13:47:08 t430 NetworkManager[454]: <info>  [1590238028.0510] device (wlp3s0): state change: activated -> failed (reason 'dhcp-start-failed', sys-iface-state: 'managed')


May 23 13:47:08 t430 NetworkManager[454]: <info>  [1590238028.0526] manager: NetworkManager state is now DISCONNECTED
May 23 13:47:08 t430 kernel: wlp3s0: deauthenticating from 70:4f:57:97:52:06 by local choice (Reason: 3=DEAUTH_LEAVING)
May 23 13:47:08 t430 dunst[1185]: WARNING: No icon found in path: 'nm-no-connection'
May 23 13:47:08 t430 dhcpcd[492]: wlp3s0: soliciting a DHCPv6 lease
May 23 13:47:08 t430 wpa_supplicant[570]: wlp3s0: CTRL-EVENT-DISCONNECTED bssid=70:4f:57:97:52:06 reason=3 locally_generated=1
May 23 13:47:08 t430 dhcpcd[492]: wlp3s0: carrier lost



May 23 13:47:08 t430 avahi-daemon[451]: Interface wlp3s0.IPv6 no longer relevant for mDNS.
May 23 13:47:08 t430 avahi-daemon[451]: Leaving mDNS multicast group on interface wlp3s0.IPv6 with address fe80::fd81:7780:6410:e759.
May 23 13:47:08 t430 avahi-daemon[451]: Interface wlp3s0.IPv4 no longer relevant for mDNS.
May 23 13:47:08 t430 avahi-daemon[451]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.1.106.
May 23 13:47:08 t430 NetworkManager[454]: <info>  [1590238028.0927] device (wlp3s0): set-hw-addr: set MAC address to 66:51:DB:82:D6:15 (scanning)
May 23 13:47:08 t430 avahi-daemon[451]: Withdrawing address record for fe80::c685:c3d0:8b05:a9e5 on wlp3s0.
May 23 13:47:08 t430 avahi-daemon[451]: Withdrawing address record for fe80::fd81:7780:6410:e759 on wlp3s0.
May 23 13:47:08 t430 avahi-daemon[451]: Withdrawing address record for 192.168.1.106 on wlp3s0.


May 23 13:47:08 t430 dhcpcd[5441]: ps_bpf_recvbpf: Network is down

答案1

@eblock 对上述问题的评论建议查看系统日志。

我这样做了,并至少部分地为有问题的第三个位置确定了一个可行的解决方案,如上所述。

网络连接循环已停止,连接现已稳定。

这并不是说我已经找到了问题的根源,但我可能已经找到了。

这是我的解决方案:

  1. 重新启动笔记本电脑,并让它开始循环打开和关闭 Wi-Fi 网络连接。

  2. 在终端中,journalctl -ef通过如上所述的连接和断开步骤,键入、观察系统实时日志输出循环。

  3. 将日志输出到文本文件journalctl -ef > journal_output.txt

  4. 在文本编辑器中打开此文件vim,并仅通过连接和断开来识别与一个周期相关的部分,仅包含大约 14 秒的信息。

我已将此系统日志输出添加到上面的问题中,作为修正。

从这个输出中,我能够确定路由器没有发出 ipv6 地址,或者笔记本电脑由于某种原因无法设置 ipv6 地址,这导致“NetworkManager”断开网络连接连接。

此问题可能是由最近的路由器固件升级引起的,但是我有一台相同的笔记本电脑,安装了或多或少相同的软件,但不存在此网络连接问题。此外,路由器 LAN 上的其他设备也不会遇到这种循环连接/断开连接问题。也就是说,我认为可能是在路由器固件升级时,这个问题开始出现的,我对此并不确定。

修复 为了解决这个问题,我只是在nm-applet第三个位置的网络管理器 GUI 选项卡中禁用了 wifi 和以太网电缆连接的 ipv6 连接。禁用后,wifi 和有线以太网连接都会以持久一致的方式连接到网络,不会循环连接和断开连接。

答案2

调试

调试问题的另一种方法是通过以下更改来提高日志记录级别/etc/NetworkManager/NetworkManager.conf

[logging]
level=DEBUG

然后运行以下命令以获得更好的消息/var/log/syslog

sudo systemctl restart NetworkManager

我在我管理的 4-5 台 Ubuntu 机器上看到了同样的问题,但是带有有线连接的台式机。在大多数此类计算机上,NetworkManager 状态循环会显示如下消息:

Dec  7 01:36:56 vandebun-home whoopsie[1483]: [01:36:56] offline
Dec  7 01:36:56 vandebun-home dbus-daemon[890]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.11' (uid=0 pid=891 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
Dec  7 01:36:56 vandebun-home systemd[1]: Starting Network Manager Script Dispatcher Service...
Dec  7 01:36:56 vandebun-home dbus-daemon[890]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec  7 01:36:56 vandebun-home systemd[1]: Started Network Manager Script Dispatcher Service.
Dec  7 01:36:57 vandebun-home NetworkManager[891]: <info>  [1638862617.8397] manager: NetworkManager state is now CONNECTED_GLOBAL
Dec  7 01:36:57 vandebun-home whoopsie[1483]: [01:36:57] The default IPv4 route is: /org/freedesktop/NetworkManager/ActiveConnection/1
Dec  7 01:36:57 vandebun-home whoopsie[1483]: [01:36:57] Not a paid data plan: /org/freedesktop/NetworkManager/ActiveConnection/1
Dec  7 01:36:57 vandebun-home whoopsie[1483]: [01:36:57] Found usable connection: /org/freedesktop/NetworkManager/ActiveConnection/1
Dec  7 01:36:59 vandebun-home whoopsie[1483]: [01:36:59] online
Dec  7 01:37:08 vandebun-home systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Dec  7 01:45:01 vandebun-home CRON[1667743]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Dec  7 01:47:17 vandebun-home NetworkManager[891]: <info>  [1638863237.3144] manager: NetworkManager state is now CONNECTED_SITE
Dec  7 01:47:17 vandebun-home whoopsie[1483]: [01:47:17] offline

offline请注意,在上面的日志中,和online消息之间的差异whoopsie只有几秒钟。为了总结这些日志中发生的情况,NetworkManager 每 5 分钟(300 秒,请参阅CONNECTIVITY)运行一次检查man NetworkManager.conf,其中连通性检查失败并离线。然后它立即运行另一个连接检查,检查通过后又恢复在线状态。在这些特定日志中,重新上线的时间只有几秒钟,但在其他机器上则需要几分钟,这是一个问题。

通过调试日志记录,我在使 NetworkManager 脱机的连接检查期间看到了这一点:

Dec  7 14:39:49 vandebun-home gnome-control-c[1709862]: Failed fetch permissions from flatpak permission store: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for location
Dec  7 14:40:17 vandebun-home NetworkManager[1705563]: <debug> [1638909617.4571] ndisc-lndp[0x5634385a0e20,"enp3s0"]: processing libndp events
Dec  7 14:40:20 vandebun-home NetworkManager[1705563]: <debug> [1638909620.1503] connectivity: (tun0,IPv6,142) start request to 'http://connectivity-check.ubuntu.com/' (try resolving 'connectivity-check.ubuntu.com' using systemd-resolved)
Dec  7 14:40:20 vandebun-home NetworkManager[1705563]: <debug> [1638909620.1521] connectivity: (tun0,IPv6,142) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
Dec  7 14:40:20 vandebun-home NetworkManager[1705563]: <debug> [1638909620.3694] connectivity: (tun0,IPv6,142) check completed: LIMITED; check failed: (6) Couldn't resolve host name
Dec  7 14:40:26 vandebun-home NetworkManager[1705563]: <debug> [1638909626.1534] connectivity: (tun0,IPv4,143) skip connectivity check due to no global route configured
Dec  7 14:40:26 vandebun-home NetworkManager[1705563]: <debug> [1638909626.1535] connectivity: (tun0,IPv4,143) check completed: LIMITED; no global route configured
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.5394] connectivity: (docker0,IPv6,144) start request to 'http://connectivity-check.ubuntu.com/' (try resolving 'connectivity-check.ubuntu.com' using systemd-resolved)
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.5396] connectivity: (enp3s0,IPv6,145) start request to 'http://connectivity-check.ubuntu.com/' (try resolving 'connectivity-check.ubuntu.com' using systemd-resolved)
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.5410] connectivity: (docker0,IPv6,144) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.5509] connectivity: (enp3s0,IPv6,145) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoSuchRR: 'connectivity-check.ubuntu.com' does not have any RR of the requested type
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.9151] connectivity: (docker0,IPv6,144) check completed: LIMITED; check failed: (6) Couldn't resolve host name
Dec  7 14:41:09 vandebun-home NetworkManager[1705563]: <debug> [1638909669.9691] connectivity: (enp3s0,IPv6,145) check completed: LIMITED; check failed: (6) Couldn't resolve host name
Dec  7 14:41:15 vandebun-home NetworkManager[1705563]: <debug> [1638909675.5200] connectivity: (docker0,IPv4,146) skip connectivity check due to no global route configured
Dec  7 14:41:15 vandebun-home NetworkManager[1705563]: <debug> [1638909675.5201] connectivity: (docker0,IPv4,146) check completed: LIMITED; no global route configured
Dec  7 14:43:26 vandebun-home NetworkManager[1705563]: <debug> [1638909806.3332] connectivity: (enp3s0,IPv4,147) start request to 'http://connectivity-check.ubuntu.com/' (try resolving 'connectivity-check.ubuntu.com' using systemd-resolved)

请注意,大多数错误都与IPv6这些日志相关。想必我可以在所有网络接口上禁用 IPv6 并解决问题,就像您一样。

替代解决方案

另一个选择是禁用连接检查:

[connectivity]
interval=0

对于那些没有在笔记本电脑上漫游的人来说,您可能会遇到强制门户,启用此功能确实没有太多优势(对于某些人来说,无论如何,这可能是一个隐私问题)。这可以让您稍后让 IPv6 单独工作。

我的理论(当然不确定)是“常规”连接检查(当机器已在线时每 5 分钟运行一次)尚未为 IPv6 做好准备。也就是说,它似乎没有进行健全性检查来证明 IPv4 连接就足够了。 NetworkManager 离线后运行的连接检查仅检查 IPv4(因此循环)。

相关内容