ubuntu14.04 中检测不到以太网。只有在运行“sudo ethtool -s eth0 autoneg off speed 100”后才能检测到,之后它就可以正常工作了。每次启动后都必须执行此操作。如何解决这个问题?ethtool eth0 的输出为:
Settings for eth0:
Supported ports:
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Half
Port:
PHYAD: 0
Transceiver: ]
Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
Current message level:
Link detected: yes
sudo lshw -C network 的输出是:
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info:
logical name: eth0
version: 10
serial:
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities:
configuration: autonegotiation=off broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-3_0.0.1 04/23/13 latency=0 link=yes multicast=yes port= speed=100Mbit/s
答案1
我建议您在 /etc/rc.local 中添加所需的行:
gksudo gedit /etc/rc.local
如果您没有文本编辑器 gedit,请使用 nano 或 kate 或 leafpad。在 exit 0 上方添加一行:
ethtool -s eth0 autoneg off speed 100
仔细校对,保存并关闭文本编辑器。一切就绪。