Ubuntu

使用 ethtool 更改網路介面速度不起作用

  • August 16, 2018

我使用的是具有 Gbps 乙太網卡的 lenevo M5 伺服器,但奇怪的是,當我讀取 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 給出無效參數。

感謝@Diamant。在探勘更多之後,連接伺服器 eth 埠的 CABLE 之一似乎有問題,更換它解決了問題。

檢查路由器上特定埠的埠速度配置,它可能限制為 100Mbps,或者自動協商失敗,在這種情況下您可以將其修復為 1000Mbps。

命令取決於您的路由器,這裡是一個cisco 範例

引用自:https://serverfault.com/questions/924241