我有两台具有相同主板的计算机,它们有两个以太网端口。
在一台计算机上,它运行良好,没有任何问题。
在另一台计算机上,不知何故,其中一个端口被 Linux 禁用(我验证了 BIOS 并且它在那里被启用),并且另一个端口的速度被限制为 100Mbps 而不是预期的 1Gbps,虽然这可能是我的电缆导致了问题。
这是 ifconfig 的示例。在出现问题的计算机上,缺少 p5p1。
$ ifconfig
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:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:1292 (1.2 KB) TX bytes:1292 (1.2 KB)
p4p1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.0.0
inet6 addr: xx::xx:xx:xx:xx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:296 errors:0 dropped:0 overruns:0 frame:0
TX packets:270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:315437 (315.4 KB) TX bytes:32060 (32.0 KB)
Interrupt:16 Memory:f7200000-f7220000
[following missing on computer with problem]
p5p1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
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)
Interrupt:17 Memory:df100000-df120000
所以我查看了lshw
网络信息,找到p5p1
了,但不知何故它被禁用了。如果我将电缆连接到该端口,端口会按预期唤醒(即我看到灯亮了),但在 Linux 下它仍然不见了。
$ sudo lshw -c NET
*-network
description: Ethernet interface
product: 82574L Gigabit Network Connection
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: p4p1
version: 00
serial: xx:xx:xx:xx:xx:xx
size: 100Mbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=2.1-2 ip=10.0.0.1 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:16 memory:f7200000-f721ffff ioport:d000(size=32) memory:f7220000-f7223fff
*-network DISABLED
description: Ethernet interface
product: 82574L Gigabit Network Connection
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:04:00.0
logical name: p5p1
version: 00
serial: xx:xx:xx:xx:xx:xx
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=2.1-2 latency=0 link=no multicast=yes port=twisted pair
resources: irq:17 memory:f7100000-f711ffff ioport:c000(size=32) memory:f7120000-f7123fff
知道为什么 Linux 会在启动时禁用某个端口吗?
更新:
我发现我可以使用以下命令启用以太网端口:
sudo ip link set up p5p1
但这并不能真正解释它为何会宕机。重启后它又恢复为禁用状态。
按照 Chai T. Rex 的建议,我将长电缆连接到另一台具有 1Gbps 连接的计算机,它工作正常。我看到连接速度为 1Gbps 而不是 100Mbps...