网卡速率和双工模式的配置.docx
1、mii-tool配置网络设备协商方式的工具;
mii-tool介绍;
mii-tool-view,manipulatemedia-independentinterfacestatus(mii-tool是查看,管理介质的网络接口的状态)
有时网卡需要配置协商方式,比如10/100/1000M的网卡半双工、全双工、自动协商的配置。但大多数的性设备是不用我们来修改协商,因为大多数网络设置接入的时候,都采用自动协商来解决相互通信的问题。不过自动协商也不是万能的,有时也会出现错误,比如丢包率比较高,这时就要我们来指定网卡的协商方式。
mii-tool就是能指定网卡的协商方式。下面我们说一说mii-tool的用法;
mii-tool的用法;
mii-tool在更改网络设备通信协商方式的方法比较简单,用-v参数来查看网络接口的状态;看下面的例子;
mii-tool更改网络接口协商的方法;
[root@localhost~]#mii-tool--helpusage:mii-tool[-VvRrwl][-Amedia,...
[root@localhost~]#mii-tool--helpusage:mii-tool[-VvRrwl][-Amedia,...
-V,--version
-v,--verbose
络接口的信息;
-R,--reset
重设MII到开启状态;
-r,--restart
启自动协商模式;
-w,--watch
注:查看网络接口连接的状态变化;
-l,--log
注:写入事件到系统日志;
-A,--advertise二media,...
注:指令特定的网络接口;
-F,--force=media
注:更改网络接口协商方式;
|-Fmedia][interface...]displayversioninformationmoreverboseoutput注:显示网
resetMIItopoweronstate注:restartautonegotiation注:重monitorforlinkstatuschangeswith-w,writeeventstosyslogadvertiseonlyspecifiedmediaforcespecifiedmediatechnology
media:100baseT4,100baseTx-FD,100baseTx-HD,10baseT-FD,10baseT-HD,
(toadvertisebothHDandFD)100baseTx,10baseT
大实例一:查看网络接口的协商状态;
[root@localhost~]#mii-tool-veth0
eth0:negotiated100baseTx-FD,linkok
productinfo:vendor00:00:00,model0rev0
basicmode:autonegotiationenabled
basicstatus: autonegotiationcomplete, linkok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
linkpartner: 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-F100baseTx-FD
[root@localhost~]#mii-tool-veth0
eth0:100Mbit,fullduplex,linkok
productinfo:vendor00:00:00,model0rev0
basicmode:100Mbit,fullduplex
basicstatus:linkok
capabilities:100baseTx-FD