linux网卡速率和双工模式的配置
查看网络接口的协商状态 [root@localhost]# mii-tool -v eth0 eth0: negotiated 100baseTx-FD, link ok product info: vendor 00:00:00, model 0 rev 0 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control 注:上面的例子,我们可以看得到是自动协商。注意红字的部份; 更改网络接口协商方式; 更改网络接口的协商方式,我们要用到-F选项,后面可以接 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD等参数; 把网络接口eth0改为 1000Mb/s全双工的模式 [root@localhost]# mii-tool -F 100baseTx-FD
[root@localhost]#mii-tool -v eth0 eth0: 100 Mbit, full duplex, link ok product info: vendor 00:00:00, model 0 rev 0 basic mode: 100 Mbit, full duplex basic status: link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD 也可以使用ethtool工具修改: [root@localhost]# ethtool -s eth0 speed 100 duplex full ethtool 工具关于网络协商功能介绍 ethtool - Display or change ethernet card settings(ethtool 是用来显示和更改网卡设置的工具);这个工具比较复杂,功能也特别多; ethtool 显示网络端口设置功能 [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 -s DEVNAME \ [ speed 10|100|1000 ] \ [ duplex half|full ] \ [ port tp|aui|bnc|mii|fibre ] \ [ autoneg on|off ] \ 把网卡eth0 速度改为10Mb/s,采用半双工; [root@localhost]# ethtool -s eth1 speed 10 duplex half [root@localhost]# 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@localhost]# ethtool -s eth1 speed 100 duplex full [root@localhost]# 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网卡没有激活;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。