1. 程式人生 > >linux 下mii-tool ethtool 命令簡單的使用

linux 下mii-tool ethtool 命令簡單的使用

linux下mii-tool ethtool 命令簡單的使用

################################################################

通過命令查看linux網卡的物理信息,狀態:

[[email protected] ~]# mii-tool eth0

eth0: negotiated 100baseTx-FD, link ok

-V 顯示版本信息; -v 顯示網絡接口的信息;

-R 重設MII到開啟狀態; -r 重啟自動協商模式;

-w 查看網絡接口連接的狀態變化; -l 寫入事件到系統日誌;

-A 指令特定的網絡接口; -F 更改網絡接口協商方式;


如果我們想把網絡接口eth0改為1000Mb/s全雙工的模式應該怎麽辦呢?

[[email protected] ~]# mii-tool -F 100baseTx-FD

#################################################################

通過mii-tool命令查看的信息實在是太少了,還可用下面的命令查看更多的網卡信息。


通過ethtool eth0來查看更多的底層信息:

[[email protected] ~]# ethtool eth0

Settings for eth0:

Supported ports: [ TP ]

Supported link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Supported pause frame use: No //是否支持熱插拔

Supports auto-negotiation: Yes //是否支持自動協商

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Advertised pause frame use: No

Advertised auto-negotiation: Yes

Speed: 1000Mb/s //速率

Duplex: Full //全雙工

Port: Twisted Pair //電口

PHYAD: 0

Transceiver: internal

Auto-negotiation: on

MDI-X: Unknown

Supports Wake-on: d

Wake-on: d

Current message level: 0x00000007 (7)

drv probe link

Link detected: yes


通過ethtool -i eth0 可以來查看網卡的驅動信息:

[[email protected] ~]# ethtool -i eth0 //網卡的驅動版本

driver: e1000

version: 7.3.21-k8-NAPI

firmware-version:

bus-info: 0000:02:01.0

supports-statistics: yes

supports-test: yes

supports-eeprom-access: yes

supports-register-dump: yes

supports-priv-flags: no


可以通過ethtool -S eth0來查看網卡的工作狀態:

如:可以查看網卡的輸入流量,輸出流量,輸入包,輸出包,輸入的廣播,輸出的廣播,輸入的網絡錯包,輸出的網絡錯包等。。。


linux 下mii-tool ethtool 命令簡單的使用