互联网连接 10 秒后断开

互联网连接 10 秒后断开

我在 Ubuntu 20.04 中遇到了有线连接问题。当我重新启动有线连接时,互联网连接了 10 秒,然后互联网断开了。连接到另一个以太网后发生这种情况。我已经在同一个设备上的 Windows 中测试过,有线连接工作正常。

ifconfig

br-01eaafad0ac5: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:c2:c2:d7:40  txqueuelen 0  (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

br-8af8a389b013: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.49.1  netmask 255.255.255.0  broadcast 192.168.49.255
        ether 02:42:a3:bb:fd:20  txqueuelen 0  (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

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:13:f0:9d:0a  txqueuelen 0  (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

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.125  netmask 255.255.255.0  broadcast 172.17.0.255
        inet6 fe80::bdbd:d4d3:27b0:da2b  prefixlen 64  scopeid 0x20<link>
        ether 8c:0f:6f:72:74:2e  txqueuelen 1000  (Ethernet)
        RX packets 72  bytes 15513 (15.5 KB)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 304  bytes 25513 (25.5 KB)
        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 1613  bytes 148550 (148.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1613  bytes 148550 (148.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 40:9f:38:0c:4d:97  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

wlx1062eb320a88: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.3  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::d8c2:1da0:643e:f5cf  prefixlen 64  scopeid 0x20<link>
        ether 10:62:eb:32:0a:88  txqueuelen 1000  (Ethernet)
        RX packets 4026  bytes 7045370 (7.0 MB)
        RX errors 0  dropped 265  overruns 0  frame 0
        TX packets 2740  bytes 1329710 (1.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sudo lshw -C network

  *-network                 
       description: Wireless interface
       product: RTL8723BE PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: wlp1s0
       version: 00
       serial: 40:9f:38:0c:4d:97
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtl8723be driverversion=5.8.0-48-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11
       resources: irq:17 ioport:e000(size=256) memory:df100000-df103fff
  *-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:02:00.0
       logical name: enp2s0
       version: 15
       serial: 8c:0f:6f:72:74:2e
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix 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.8.0-48-generic duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=172.17.0.125 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:19 ioport:d000(size=256) memory:df004000-df004fff memory:df000000-df003fff
  *-network
       description: Wireless interface
       physical id: 1
       bus info: usb@1:6
       logical name: wlx1062eb320a88
       serial: 10:62:eb:32:0a:88
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=r8188eu driverversion=5.8.0-48-generic ip=192.168.43.3 multicast=yes wireless=IEEE 802.11bgn

dmesg | grep e1000e: 没有什么

dmesg | grep r81

[    0.026270] percpu: Embedded 56 pages/cpu s192512 r8192 d28672 u524288
[    0.026275] pcpu-alloc: s192512 r8192 d28672 u524288 alloc=1*2097152
[    0.676015] libphy: r8169: probed
[    0.676174] r8169 0000:02:00.0 eth0: RTL8168h/8111h, 8c:0f:6f:72:74:2e, XID 541, IRQ 126
[    0.676175] r8169 0000:02:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[    0.677083] r8169 0000:02:00.0 enp2s0: renamed from eth0
[    3.588250] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
[    3.709693] usbcore: registered new interface driver r8188eu
[    3.986279] r8188eu 1-6:1.0 wlx1062eb320a88: renamed from wlan0
[    6.410031] Generic FE-GE Realtek PHY r8169-200:00: attached PHY driver [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[    6.609967] r8169 0000:02:00.0 enp2s0: Link is Down
[  319.190371] r8169 0000:02:00.0 enp2s0: Link is Up - 1Gbps/Full - flow control off
[27285.099624] r8169 0000:02:00.0 enp2s0: Link is Down
[27292.060262] Generic FE-GE Realtek PHY r8169-200:00: attached PHY driver [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[27292.244453] r8169 0000:02:00.0 enp2s0: Link is Down
[27296.397106] r8169 0000:02:00.0 enp2s0: Link is Up - 1Gbps/Full - flow control off
[29075.912170] r8188eu 1-6:1.0 wlx1062eb320a88: renamed from wlan0
[59818.035387] r8169 0000:02:00.0 enp2s0: Link is Down
[59821.142964] Generic FE-GE Realtek PHY r8169-200:00: attached PHY driver [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[59821.339009] r8169 0000:02:00.0 enp2s0: Link is Down
[59825.437233] r8169 0000:02:00.0 enp2s0: Link is Up - 1Gbps/Full - flow control off

lsmod | grep r81

r8188eu               430080  0
lib80211               16384  1 r8188eu
cfg80211              778240  3 rtlwifi,mac80211,r8188eu
r8169                  77824  0

apt-cache policy r8168-dkms

r8168-dkms:
  Installed: (none)
  Candidate: 8.048.00-1ubuntu0.20.04.1
  Version table:
     8.048.00-1ubuntu0.20.04.1 500
        500 http://ir.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
        500 http://ir.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages
     8.048.00-1 500
        500 http://ir.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://ir.archive.ubuntu.com/ubuntu focal/universe i386 Packages

答案1

简短版本:安装r8168-dkms包:

apt install r8168-dkms

然后重新启动以停用旧驱动程序并激活新驱动程序。(这也可以不重新启动来完成,但重新启动更简单。)

长版本:这似乎是r8169驱动程序中的一个已知错误:

ubuntu 20.4-使用 r8169 重新传输

我运行了一些网络测试(iperf3),发现 ubuntu 20.4 内核 5.4.0-29 中存在大量重传。我使用模块 r8169 作为网络适配器

03:00.0 以太网控制器:瑞昱半导体有限公司 RTL8111/8168/8411 PCI Express 千兆以太网控制器 (rev 15)

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1880076

live iso 20.04 没有有线网络

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1875126

我认为它可能也与这些上游错误报告有关:

通过 r8169 驱动程序提供服务的板载网络 Realtek RTL8111E 控制器无法在内核版本 5.3 (5.3.18-lp152.33-default openSUSE Leap 15.2) 和 5.8 (5.8.1-3.1.g846658e) 上提供稳定的网络连接。一些类似的错误报告中提到的解决方法是禁用 ASPM (pcie_aspm=off),但这并不能稳定网络。

https://bugzilla.kernel.org/show_bug.cgi?id=209081

Starting from kernel 5.3-rc1, the r8169 driver oops during os boot.
I can not use the network.

https://bugzilla.kernel.org/show_bug.cgi?id=204343

如果您需要重新加载驱动程序而不重新启动,可以通过以下命令完成:

sudo rmmod r8169
sudo modprobe r8168
sudo /etc/init.d/networking restart

如果它在重新启动后停止工作,请尝试以下操作以确保r8169驱动程序不会在启动时加载:

echo 'blacklist r8169' | sudo tee -a /etc/modprobe.d/blacklist.conf

有关的:

相关内容