在将笔记本电脑插入底座工作站后,需要重新连接以太网电缆才能使其正常工作

在我的Ubuntu 17.04戴尔Latitude笔记本电脑上,我使用扩展坞。 该站有专用连接。

  1. 当我将笔记本电脑停靠在工作站时,它无限期地显示“连接”状态图标。 就像它试图连接,然后重置,然后再次尝试连接。
  2. 当我拔下电缆时,稍等一下再连接,连接立即启动。

从睡眠中恢复时可能会更频繁地发生。 但尝试更改BIOS电源选项无济于事。

它在Ubuntu 16.10上工作正常,但我不确定17.04之后是否出现问题,因为其他因素也发生了变化。

笔记本电脑和路由器之间有相当旧的10 / 100Mbit交换机,可能连接协商时间太长了? 但网络打印机连接没有问题。

更新:尝试使用modprobe -r -v tg3modprobe -v rg3重新加载以太网驱动程序并重新启动网络服务。

运行dmesg显示了很多链接/链接消息:

 [92580.119745] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92580.119768] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92580.774047] tg3 0000:09:00.0 eth0: Link is down [92582.426348] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92582.426351] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92583.368441] tg3 0000:09:00.0 eth0: Link is down [92585.047635] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92585.047662] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92585.562763] tg3 0000:09:00.0 eth0: Link is down [92587.207396] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92587.207418] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92588.085716] tg3 0000:09:00.0 eth0: Link is down [92589.744788] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92589.744816] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92590.706366] tg3 0000:09:00.0 eth0: Link is down [92592.296863] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [92592.365857] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92592.365860] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92592.365876] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [92593.326975] tg3 0000:09:00.0 eth0: Link is down [92594.987186] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92594.987212] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92595.947772] tg3 0000:09:00.0 eth0: Link is down [92597.608392] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92597.608416] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX [92598.568514] tg3 0000:09:00.0 eth0: Link is down [92600.229535] tg3 0000:09:00.0 eth0: Link is up at 100 Mbps, full duplex [92600.229548] tg3 0000:09:00.0 eth0: Flow control is on for TX and on for RX 

连接停止时Wireshark记录:

 No. Time Source Destination Protocol Length Info 7 2.660584149 0.0.0.0 255.255.255.255 DHCP 342 DHCP Request - Transaction ID 0xde0c185d Frame 7: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0 Ethernet II, Src: Dell_39:4b:6e (d0:67:e5:39:4b:6e), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255 User Datagram Protocol, Src Port: 68, Dst Port: 67 Bootstrap Protocol (Request) No. Time Source Destination Protocol Length Info 12 5.401359750 0.0.0.0 255.255.255.255 DHCP 342 DHCP Request - Transaction ID 0xde0c185d Frame 12: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0 Ethernet II, Src: Dell_39:4b:6e (d0:67:e5:39:4b:6e), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255 User Datagram Protocol, Src Port: 68, Dst Port: 67 Bootstrap Protocol (Request) No. Time Source Destination Protocol Length Info 35 13.832656290 0.0.0.0 255.255.255.255 DHCP 342 DHCP Discover - Transaction ID 0xb9200f10 Frame 35: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0 Ethernet II, Src: Dell_39:4b:6e (d0:67:e5:39:4b:6e), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255 User Datagram Protocol, Src Port: 68, Dst Port: 67 Bootstrap Protocol (Discover) 

Wireshark在重新连接电缆后记录:

 No. Time Source Destination Protocol Length Info 13 12.440180322 0.0.0.0 255.255.255.255 DHCP 342 DHCP Request - Transaction ID 0xc06e5459 Frame 13: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0 Ethernet II, Src: Dell_39:4b:6e (d0:67:e5:39:4b:6e), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255 User Datagram Protocol, Src Port: 68, Dst Port: 67 Bootstrap Protocol (Request) No. Time Source Destination Protocol Length Info 14 12.444870618 192.168.1.254 192.168.1.5 DHCP 358 DHCP ACK - Transaction ID 0xc06e5459 Frame 14: 358 bytes on wire (2864 bits), 358 bytes captured (2864 bits) on interface 0 Ethernet II, Src: VtechTel_55:61:31 (00:12:2a:55:61:31), Dst: Dell_39:4b:6e (d0:67:e5:39:4b:6e) Internet Protocol Version 4, Src: 192.168.1.254, Dst: 192.168.1.5 User Datagram Protocol, Src Port: 67, Dst Port: 68 Bootstrap Protocol (ACK) No. Time Source Destination Protocol Length Info 15 12.463981621 192.168.1.5 224.0.0.22 IGMPv3 62 Membership Report / Join group 224.0.0.252 for any sources / Join group 224.0.0.251 for any sources Frame 15: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0 Ethernet II, Src: Dell_39:4b:6e (d0:67:e5:39:4b:6e), Dst: IPv4mcast_16 (01:00:5e:00:00:16) Internet Protocol Version 4, Src: 192.168.1.5, Dst: 224.0.0.22 Internet Group Management Protocol 

几个月前,自动更新在以太网暂停/恢复完全工作6个月左右之后就中断了。 它在同一时间发生在其他一些用户身上。

我的解决方案是创建一个从suspend恢复时执行的脚本:

 #!/bin/bash # NAME: r8169-reset # PATH: /lib/systemd/system-sleep # DESC: Reset Ethernet card after suspend, not working automatically # DATE: Feb ?? 2017. Modified: Apr 30, 2017. MYNAME=$0 restart_ethernet() { /usr/bin/logger $MYNAME 'restart_ethernet(r8169) BEGIN' /sbin/modprobe -v -r r8169 # /sbin/modprobe -v -r mii /sbin/modprobe -v r8169 /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESED)' /usr/bin/logger $MYNAME 'restart_ethernet(r8169) END' } /usr/bin/logger $MYNAME 'case=[' ${1}' ]' case "${1}/${2}" in hibernate|suspend|pre*) ;; resume|thaw|post*) restart_ethernet;; esac 

将脚本保存到/lib/systemd/system-sleep/r8169-reset 。 当然,将此脚本名称更改为您的实际驱动程序名称。 还要更改脚本中的驱动程序内核模块名称。

注意这一行:

 /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESED)' 

有时只需重新启动网络管理器即可,您也可以尝试。

你需要sudo权力来保存文件。 为了更好地衡量,我总是将这些脚本标记为executable

 sudo chmod a+x /lib/systemd/system-sleep/r8169-reset 

您可以检查/var/log/syslog以查看脚本的输出。

希望这对你有用。