Ubuntu 22.04 LTS 需要频繁重启以太网

Ubuntu 22.04 LTS 需要频繁重启以太网

远程排除系统故障。用户描述称,有时他们必须在设置中打开和关闭“网络”按钮 20 次才能连接到网络。在 Ubuntu 18.04 LTS 上他们无需这样做。

这是 sudo lshw 和 lspci

$ sudo lshw -c network
[sudo] password: 
  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: enp3s0
       version: 1b
       serial: b0:4f:13:15:4f:35
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.15.0-39-generic duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.88 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:16 ioport:3000(size=256) memory:d1204000-d1204fff memory:d1200000-d1203fff
$ 
$ lspci
.......
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 1b)
.......

听从某人的建议并通过以下方式查看 NetworkManager 日志:

sudo journalctl -b 0 -u NetworkManager

看起来确实有些不对劲(请记住,这是一台不同的机器,但问题是一样的)。如果我理解正确的话,你可以清楚地看到那个家伙在它工作之前打开和关闭了一次。在运行时,还有一两个东西出现故障,但我不知道它们中哪些有问题。顺便说一句,只有 enp2s0 是插入了以太网的那个。

csplt-hx500@csplthx500-HX500:~$ sudo journalctl -b 0 -u NetworkManager
Feb 04 11:31:02 csplthx500-HX500 systemd[1]: Starting Network Manager...
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.8597] NetworkManager (version 1.36.6) is starting... (for the first time)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.8597] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr->
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.8638] bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"
Feb 04 11:31:02 csplthx500-HX500 systemd[1]: Started Network Manager.
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.8765] manager[0x55f917acb040]: monitoring kernel firmware directory '/lib/firmware'.
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.8765] monitoring ifupdown state file '/run/network/ifstate'.
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9628] hostname: hostname: using hostnamed
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9628] hostname: static hostname changed from (none) to "csplthx500-HX500"
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9643] dns-mgr[0x55f917aa4aa0]: init: dns=systemd-resolved rc-manager=unmanaged (auto), plugin=systemd-resolved
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9701] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/ieee80211/phy0/rfkill1) (drive>
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9702] manager[0x55f917acb040]: rfkill: Wi-Fi hardware radio set disabled
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9702] manager[0x55f917acb040]: rfkill: WWAN hardware radio set enabled
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9775] Loaded device plugin: NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wifi.so)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9787] Loaded device plugin: NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-adsl.so)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9814] Loaded device plugin: NMTeamFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-team.so)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9849] Loaded device plugin: NMWwanFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wwan.so)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9879] Loaded device plugin: NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-bluetooth.so)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9881] manager: rfkill: Wi-Fi disabled by radio killswitch; disabled by state file
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9882] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9882] manager: Networking is enabled by state file
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9922] settings: Loaded settings plugin: ifupdown ("/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-settings-plugin-ifupdow>
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9923] settings: Loaded settings plugin: keyfile (internal)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9923] ifupdown: management mode: unmanaged
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9926] ifupdown: interfaces file /etc/network/interfaces doesn't exist
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9963] dhcp-init: Using DHCP client 'internal'
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9964] device (lo): carrier: link connected
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9965] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9973] manager: (enp0s31f6): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
Feb 04 11:31:02 csplthx500-HX500 NetworkManager[814]: <info>  [1675531862.9975] device (enp0s31f6): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2185] manager: (enp2s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3)
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2187] device (enp2s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2457] device (wlp1s0): driver supports Access Point (AP) mode
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2460] manager: (wlp1s0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/4)
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2462] device (wlp1s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2479] failed to open /run/network/ifstate
Feb 04 11:31:03 csplthx500-HX500 NetworkManager[814]: <info>  [1675531863.2516] modem-manager: ModemManager available
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1627] device (enp2s0): carrier: link connected
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1629] device (enp2s0): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1656] policy: auto-activating connection 'Wired connection 2' (f9e7b32b-5b2d-3a0c-893f-0140a8865531)
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1659] device (enp2s0): Activation: starting connection 'Wired connection 2' (f9e7b32b-5b2d-3a0c-893f-0140a8865531)
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1659] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1661] manager: NetworkManager state is now CONNECTING
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1661] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1670] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:06 csplthx500-HX500 NetworkManager[814]: <info>  [1675531866.1701] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.3498] agent-manager: agent[0a65f937a10aa8cc,:1.55/org.gnome.Shell.NetworkAgent/1000]: agent registered
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4088] dhcp4 (enp2s0): state changed new lease, address=172.16.0.137
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4105] device (enp2s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4143] device (enp2s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4145] device (enp2s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4147] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4150] manager: NetworkManager state is now CONNECTED_SITE
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4150] policy: set 'Wired connection 2' (enp2s0) as default for IPv4 routing and DNS
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4155] device (enp2s0): Activation: successful, device activated.
Feb 04 11:31:10 csplthx500-HX500 NetworkManager[814]: <info>  [1675531870.4159] manager: startup complete
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6010] device (enp2s0): state change: activated -> deactivating (reason 'user-requested', sys-iface-state: 'managed')
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6015] manager: NetworkManager state is now DISCONNECTING
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6038] audit: op="device-disconnect" interface="enp2s0" ifindex=2 pid=2117 uid=1000 result="success"
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6239] device (enp2s0): state change: deactivating -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6613] dhcp4 (enp2s0): canceled DHCP transaction
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6613] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6614] dhcp4 (enp2s0): state changed no lease
Feb 04 11:31:38 csplthx500-HX500 NetworkManager[814]: <info>  [1675531898.6647] manager: NetworkManager state is now DISCONNECTED
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5027] device (enp2s0): Activation: starting connection 'Wired connection 2' (f9e7b32b-5b2d-3a0c-893f-0140a8865531)
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5030] audit: op="connection-activate" uuid="f9e7b32b-5b2d-3a0c-893f-0140a8865531" name="Wired connection 2" pid=2117 uid=1000 re>
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5033] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5041] manager: NetworkManager state is now CONNECTING
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5044] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5065] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5081] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5290] dhcp4 (enp2s0): state changed new lease, address=192.168.1.193
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5305] device (enp2s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5316] device (enp2s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5317] device (enp2s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5320] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5323] manager: NetworkManager state is now CONNECTED_SITE
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5323] policy: set 'Wired connection 2' (enp2s0) as default for IPv4 routing and DNS
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.5328] device (enp2s0): Activation: successful, device activated.
Feb 04 11:31:44 csplthx500-HX500 NetworkManager[814]: <info>  [1675531904.7670] manager: NetworkManager state is now CONNECTED_GLOBAL

答案1

首先尝试另一条网线和路由器。使用 查看日志sudo dmesg -w

您还可以尝试禁用自动协商 - 并降低速度:

sudo apt install ethtool
sudo ethtool -s enp3s0 speed 100 duplex full autoneg off

作为最后的手段,您可以尝试切换到 r8168 驱动程序:

sudo apt install r8168-dkms
echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf
sudo rmmod r8169; sudo modprobe r8168

但通常是您的电缆没有正确就位 - 将其取出并推回,直到听到两侧的咔嗒声。

相关内容