首页 » IDC运维 » 使用ethtool命令解决网络不通

使用ethtool命令解决网络不通

 

在机房工作中,偶尔会遇到服务器接线到机柜交换机后不通的情况,服务器IP配置正确,交换机也没有问题,但是不通外网,这时最可能的原因就是网线接错网卡了,因为服务器一般都是好几个网口。

执行
# ethtool -p eth0

时,eth0对应的网口的灯就会闪烁,你可以分别调用ethtool判断eth1,eth2对应的网口;

注意要在不插网线的时候进行,否则看不出来是否因ethtool引起的闪烁;

将网线接到配置IP的网卡上,自然就通了。

 

补充:ethtool 常用来查看网卡信息,但是最好不要用来设置网卡,现在都是自动协商的。

[[email protected] home]# ethtool eno4
Settings for eno4:
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
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s    网卡速率
Duplex: Full   #全双工
Port: Twisted Pair
PHYAD: 4
Transceiver: internal
Auto-negotiation: on
MDI-X: on
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命令解决网络不通,转载请注明来源!

0