(2010-8-18)设置网卡的协商模式--命令工具ethtool

(2010-8-18)设置网卡的协商模式--命令工具ethtool

ethtool: 显示网络端口设置功能;Linux下用于查询及设置网卡参数的命令。

本文HTML永久地址doc

[root@localhost ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: No 注:自动协商关闭
Speed: 100Mb/s 注:速度 100Mb
Duplex: Full 注:全双工
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes 注:eth0已经激活;
ethtool 设置网卡的协商模式;

在ethtool的-h帮助中我们查看到有这样的帮助信息;

ethtool -s DEVNAME \
[ speed 10|100|1000 ] \
[ duplex half|full ] \
[ port tp|aui|bnc|mii|fibre ] \
[ autoneg on|off ] \

实例一: 把网卡eth0 速度改为10Mb/s,采用半双工;

 [root@cuc03 beinan]# ethtool -s eth1 speed 10 duplex half
 [root@cuc03 beinan]# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: No
Speed: 10Mb/s 注:速度 10M/s
Duplex: Half  注:半双工
Port: MII
 PHYAD: 32
Transceiver: internal
 Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: no 注:eth1没有激活;

实例二: 把网卡eth0 速度改为100Mb/s,采用全双工;

 [root@cuc03 beinan]# ethtool -s eth1 speed 100 duplex full 
 [root@cuc03 beinan]# ethtool eth1
 Settings for eth1:
 Supported ports: [ TP MII ]
 Supported link modes:   10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Supports auto-negotiation: Yes
 Advertised link modes:  10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Advertised auto-negotiation: No
 Speed: 100Mb/s  注:速度 100M/s
 Duplex: Full 注:全双工
 Port: MII
 PHYAD: 32
 Transceiver: internal
 Auto-negotiation: off
 Supports Wake-on: pumbg
 Wake-on: d
 Current message level: 0x00000007 (7)
 Link detected: no 注:eth1网卡没有激活;

没有评论 :

发表评论