我的以太网已停止工作,只剩下无线网络:
这似乎是一个常见问题,但我还没有找到解决办法。
标准诊断
$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 68:f7:28:39:71:5d
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0:avahi Link encap:Ethernet HWaddr 68:f7:28:39:71:5d
inet addr:169.254.6.136 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2208 errors:0 dropped:0 overruns:0 frame:0
TX packets:2208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:190071 (190.0 KB) TX bytes:190071 (190.0 KB)
wlan0 Link encap:Ethernet HWaddr 74:29:af:29:9b:09
inet addr:192.168.1.94 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::7629:afff:fe29:9b09/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:689 errors:0 dropped:0 overruns:0 frame:0
TX packets:570 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:268689 (268.6 KB) TX bytes:135063 (135.0 KB)
$ sudo lshw -C 网络
*-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:01:00.0
logical name: eth0
version: 10
serial: 68:f7:28:39:71:5d
size: 10Mbit/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 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-3_0.0.1 04/23/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:61 ioport:5000(size=256) memory:c3504000-c3504fff memory:c3500000-c3503fff
*-network
description: Wireless interface
product: RTL8723BE PCIe Wireless Network Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlan0
version: 00
serial: 74:29:af:29:9b:09
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtl8723be driverversion=3.16.0-59-generic firmware=N/A ip=192.168.1.94 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
resources: irq:19 ioport:4000(size=256) memory:c3400000-c3403fff
$ lspci| grep 以太网
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search home
$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
尝试的解决方案
我已经排除了显而易见的方法(重新启动、更换电线、路由器端口),并且尝试了以下所有方法但都无济于事(因此已将它们撤消):
我尝试添加以下行:
auto eth0
iface eth0 inet dhcp
到 /etc/network/interfaces,然后重新启动服务:
$ sudo 服务网络管理器重启
我尝试在 /etc/NetworkManager/NetworkManager.conf 中将“false”更改为“true”,然后重新启动
我运行了这个(无论它做什么):
$ sudo ethtool -s eth0 速度 100 全双工
编辑
回应 Jeff Sereno 的建议:
$ sudo ifconfig eth0 up
$ sudo dhclient
RTNETLINK answers: File exists
没有变化(即使重新启动)。
$ cat /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:f7:28:39:71:5d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x10ec:0xb723 (rtl8723be)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="74:29:af:29:9b:09", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
只有一个以太网条目。
我不知道这些是否提供了新的线索,但我还运行了:
$ dmesg | grep eth0
[ 0.749460] r8169 0000:01:00.0 eth0: RTL8168g/8111g at 0xffffc9000001e000, 68:f7:28:39:71:5d, XID 10900880 IRQ 61
[ 0.749463] r8169 0000:01:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[ 20.811216] r8169 0000:01:00.0 eth0: link down
[ 20.811261] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 539.016509] r8169 0000:01:00.0 eth0: link down
[ 539.016602] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
$ sudo nm-工具
...
- Device: eth0 -----------------------------------------------------------------
Type: Wired
Driver: r8169
State: unavailable
Default: no
HW Address: 68:F7:28:39:71:5D
Capabilities:
Carrier Detect: yes
Wired Properties
Carrier: off
它说 eth0 状态为“不可用”并且有线属性为“关闭”......?
答案1
在谷歌搜索时,我发现其他人也遇到了和我一样的问题,结果却发现他们的以太网电缆无法正常工作,或者其他同样微不足道的问题。哈!真是白痴!这肯定是你首先要检查的事情!...好吧,结果电源线从我的网络交换机上滑了出来。
我将羞愧地低下头。
答案2
将 /etc/NetworkManager/NetworkManager.conf 文件恢复到原来的状态 - 您将毫无理由地破坏网络管理器。另外,从 /etc/network/interfaces 中删除 eth0 条目,因为网络管理器正在管理它。
您的以太网卡肯定没有被禁用,因此请尝试:
sudo ifconfig eth0 up
sudo dhclient
看看你是否通过这种方式获得了分配的地址。
另外,请检查 /etc/udev/rules.d/70-persistent-net.rules 文件,确保您没有定义多个“eth0”适配器(在用新硬件替换旧硬件但不重新安装操作系统时,这种情况很常见)。如果有,我建议删除显示的所有适配器,重新启动,然后让 Ubuntu 重新检测并重新填充此文件。