拔下电缆并重新插入后无网络

拔下电缆并重新插入后无网络

我有:

  • 操作系统:Ubuntu(x64)
  • 经销商编号: Ubuntu
  • 描述:Ubuntu 14.04
  • LTS 版本:14.04
  • 代码名称:可靠
  • 核心:3.13.0-29-通用

当我启动笔记本电脑时,我的网卡工作正常,但如果我拔下电缆并重新插入,它就无法工作:(

我试过了。首先获取内核驱动程序标识符:

lspci -k

...

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)
    Subsystem: Dell Device 0597
    Kernel driver in use: r8169
...

尝试从内核中删除网络模块:

sudo rmmod r8169

在系统日志中我得到:

Oct 15 09:13:53 dte-PC ModemManager[918]: <info>  (net/eth0): released by modem /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0
Oct 15 09:13:53 dte-PC NetworkManager[1126]:    SCPlugin-Ifupdown: devices removed (path: /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0, iface: eth0)
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <info> (eth0): device state change: unavailable -> unmanaged (reason 'removed') [20 10 36]
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <warn> (6) failed to find interface name for index
Oct 15 09:13:53 dte-PC NetworkManager[1126]: (nm-system.c:766):nm_system_iface_get_flags: runtime check failed: (iface != NULL)
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <error> [1413382433.46921] [nm-system.c:768] nm_system_iface_get_flags(): (unknown): failed to get interface link object
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <info> Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <info> Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <info> NetworkManager state is now CONNECTED_GLOBAL
Oct 15 09:13:53 dte-PC NetworkManager[1126]: <info> Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)

然后,尝试将前一个模块添加到内核:

sudo modprobe r8169

系统日志显示:

Oct 15 09:14:05 dte-PC kernel: [89904.000615] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Oct 15 09:14:05 dte-PC kernel: [89904.000627] r8169 0000:01:00.0: can't disable ASPM; OS doesn't have ASPM control
Oct 15 09:14:05 dte-PC kernel: [89904.000714] r8169 0000:01:00.0 (unregistered net_device): unknown MAC, using family default
Oct 15 09:14:05 dte-PC kernel: [89904.010824] r8169 0000:01:00.0 (unregistered net_device): rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
Oct 15 09:14:05 dte-PC kernel: [89904.010879] r8169 0000:01:00.0: irq 43 for MSI/MSI-X
Oct 15 09:14:05 dte-PC kernel: [89904.011165] r8169 0000:01:00.0 eth0: RTL8101e at 0xffffc90000c6a000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 43
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <warn> failed to allocate link cache: (-12) Object not found
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): carrier is OFF
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): new Ethernet device (driver: 'r8169' ifindex: 7)
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): exported as /org/freedesktop/NetworkManager/Devices/5
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): bringing up device.
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> (eth0): deactivating device (reason 'managed') [2]
Oct 15 09:14:05 dte-PC NetworkManager[1126]: <info> NetworkManager state is now DISCONNECTED
Oct 15 09:14:05 dte-PC NetworkManager[1126]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0, iface: eth0)
Oct 15 09:14:05 dte-PC NetworkManager[1126]:    SCPlugin-Ifupdown: device added (path: /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0, iface: eth0): no ifupdown configuration found.
Oct 15 09:14:05 dte-PC kernel: [89904.017022] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Oct 15 09:14:07 dte-PC ModemManager[918]: <warn>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0': not supported by any plugin

但不要紧,还是没有网络(说明网线没插好或者获取不到ip地址)。

我总是必须重新启动笔记本电脑才能使其再次工作。

有什么想法吗?

谢谢。

答案1

从上面的评论来看:

sudo service network-manager restart

解决了问题。

相关内容