linux下查看網卡是否有物理網線鏈接的命令linux
這個比較有用,幫助判斷網絡故障web
/sbin/mii-tool網絡
mii-tool(這是Linux下專門設置網卡工做模式的命令)app
1. 查看網卡的工做模式,輸入命令:spa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#mii-tool -v
SIOCGMIIREG on eth0 failed: Input
/output
error
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:50:43, model 11 rev 1
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 flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
SIOCGMIIREG on eth1 failed: Input
/output
error
eth1: negotiated 100baseTx-FD, link ok
product info: vendor 00:50:43, model 11 rev 1
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 flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
|
從以上信息中能夠看出,這兩塊網卡工做在100M全雙工自適應模式下,「100BaseTx-FD」意爲100M Full Duplex。rest
2. 更改網卡的工做模式,輸入以下Linux命令:code
mii-tool -F media [interface]orm
media可選的模式有100baseTx-FD、100baseTx-HD、10baseT-FD、10baseT-HD等。ci
Interface表明所選擇的網卡,如eth0、eth1等,默認爲eth0。get
例如,設置網卡工做在10M半雙工模式下,輸入命令:
1
|
$ mii-tool -F 10baseT-HD eth0
|
3. 恢復網卡的自適應工做模式,輸入命令:
1
|
mii-tool -r eth0
|
更詳細的使用方法能夠用mii-tool -h來得到。
mii-tool: invalid option -- h
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
-V, --version display version information
-v, --verbose more verbose output
-R, --reset reset MII to poweron state
-r, --restart restart autonegotiation
-w, --watch monitor for link status changes
-l, --log with -w, write events to syslog
-A, --advertise=media,... advertise only specified media
-F, --force=media force specified media technology
media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
(to advertise both HD and FD) 100baseTx, 10baseT
若是想深刻體驗LINUX系統的新手,也能夠先下載一個方德Linux軟件中心試用一下。
免費下載地址:http://www.nfs-cloud.cn:81/appCenter/open/softcenter