我使用的是 lenevo M5 服务器,它有 Gbps 以太网卡,但奇怪的是,当我读取 cat /sys/class/net/eth3/speed 时,它显示 100,同样,当使用 ethtool 时,它只显示 100Mbps。dmesg 和 ethtool 的输出如下。知道为什么吗
root@server1:~# dmesg |grep eth1
[ 3.027487] tg3 0000:16:00.1 eth1: Tigon3 [partno(BCM95769) rev 5719001] (PCI Express) MAC address 08:94:ef:5d:81:a2
[ 3.027497] tg3 0000:16:00.1 eth1: attached PHY is 5719C (10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[1])
[ 3.027503] tg3 0000:16:00.1 eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]
[ 3.027508] tg3 0000:16:00.1 eth1: dma_rwctrl[00000001] dma_mask[64-bit]
[ 28.133071] bond0: Adding slave eth1
[ 28.249876] bond0: Enslaving eth1 as a backup interface with an up link
[ 53.149602] tg3 0000:16:00.1 eth1: Link is up at 100 Mbps, full duplex
[ 53.149620] tg3 0000:16:00.1 eth1: Flow control is off for TX and off for RX
[ 53.149624] tg3 0000:16:00.1 eth1: EEE is disabled
# ethtool eth3
Settings for eth3:
Supported ports: [ TP ]
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: 100baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
当我尝试使用“速度”部分更改速度时,ethtool -s eth3 speed 1000 duplex full
结果为“未知”,类似地,读取(cat)文件 /sys/class/net/eth3/speed 给出了无效参数。
答案1
检查路由器上特定端口的端口速度配置,它可能被限制为 100Mbps,或者自动协商失败,在这种情况下您可以将其修复为 1000Mbps。
命令取决于你的路由器,下面是思科示例。
答案2
感谢@Diamant。经过进一步研究,发现连接服务器 eth 端口的电缆之一似乎有故障,更换后问题解决。