快捷搜索:   nginx

Ununtu 改变网卡速率

现在我们的一般都是自适应,连上网络后会自动协商并且决定网络速率和双 工模式。但是有的时候由于网络不好需要降速使用啊等原因,需要改变网卡的速率。在windows下比较简单,通过设备管理器可以方便的设置网卡的工作方 式,在linux下我们可以使用ethtool工具来达到同样的目的。ethtool的功能很强大,具体可以用man ethtool来查看。我们需要用的是:

ethtool DEVNAME

查看网卡的当前状态

ethtool -s DEVNAME [ speed 10|100|1000 ] [ duplex half|full ]

改变网卡速度和双工方式

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

[root@cuc03 beinan]# ethtool -s eth1 speed 10 duplex half[root@cuc03 beinan]# ethtool eth1Settings 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: 0×00000007 (7) Link detected: no 注:eth1没有激活;

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

[root@cuc03 beinan]# ethtool -s eth1 speed 100 duplex full[root@cuc03 beinan]# ethtool eth1Settings 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: 0×00000007 (7) Link detected: no 注:eth1网卡没有激活;

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论