時間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評論(0)
mii-tool 更改網(wǎng)絡接口協(xié)商的方法;
# mii-tool --help
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
-v, --verbose more verbose output 注:顯示網(wǎng)絡接口的信息;
-R, --reset reset MII to poweron state 注:重設MII到開啟狀態(tài);
-r, --restart restart autonegotiation 注:重啟自動協(xié)商模式;
-w, --watch monitor for link status changes 注:查看網(wǎng)絡接口連接的狀態(tài)變化;
-l, --log with -w, write events to syslog 注:寫入事件到系統(tǒng)日志;
-A, --advertise=media,... advertise only specified media 注:指令特定的網(wǎng)絡接口;
-F, --force=media force specified media technology 注:更改網(wǎng)絡接口協(xié)商方式;
media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
(to advertise both HD and FD) 100baseTx, 10baseT
?。?實例一:查看網(wǎng)絡接口的協(xié)商狀態(tài);
[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
注:上面的例子,我們可以看得到是自動協(xié)商。注意紅字的部份;
* 實例二:更改網(wǎng)絡接口協(xié)商方式;
更改網(wǎng)絡接口的協(xié)商方式,我們要用到-F選項,后面可以接 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD等參數(shù);
如果我們想把網(wǎng)絡接口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
注:是不是已經(jīng)改過來了?當然,我們也一樣用ethtool 工具來更改,比如執(zhí)行下面的命令;
[root@localhost ~]# ethtool -s eth0 speed 100 duplex full
02、ethtool 工具關于網(wǎng)絡協(xié)商功能介紹;
ethtool - Display or change ethernet card settings(ethtool 是用來顯示和更改網(wǎng)卡設置的工具);這個工具比較復雜,功能也特別多。由于洋文比較難懂。所以我們還是把網(wǎng)絡設備協(xié)商方式的設置方法說一說。
2.1 ethtool 顯示網(wǎng)絡端口設置功能;
這個功能比較好辦。就是ethtool 后面直接接網(wǎng)絽接口就行;比如下面的例子;
[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 注:自動協(xié)商關閉
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已經(jīng)激活;
2.2 ethtool 設置網(wǎng)卡的協(xié)商模式;
在ethtool的-h幫助中我們查看到有這樣的幫助信息;
ethtool -s DEVNAME
[ speed 10|100|1000 ]
[ duplex half|full ]
[ port tp|aui|bnc|mii|fibre ]
[ autoneg on|off ]
?。?實例一: 把網(wǎng)卡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沒有激活;
?。?實例二: 把網(wǎng)卡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網(wǎng)卡沒有激活;
關鍵詞標簽:linux,網(wǎng)卡模式,mii-t
相關閱讀
熱門文章 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 Tomcat9.0如何安裝_Tomcat9.0環(huán)境變量配置方法 多種操作系統(tǒng)NTP客戶端配置 Linux操作系統(tǒng)修改IP
人氣排行 Linux下獲取CPUID、硬盤序列號與MAC地址 dmidecode命令查看內(nèi)存型號 linux tc實現(xiàn)ip流量限制 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 linux下解壓rar文件 lcx.exe、nc.exe、sc.exe入侵中的使用方法 Ubuntu linux 關機、重啟、注銷 命令 查看linux服務器硬盤IO讀寫負載