ethtool
# ethtool ethX //查询ethX网口基本设置
# ethtool –h //显示ethtool的命令帮助(help)
# ethtool –i ethX //查询ethX网口的相关信息
# ethtool –d ethX //查询ethX网口注册性信息
# ethtool –r ethX //重置ethX网口到自适应模式
# ethtool –S ethX //查询ethX网口收发包统计
# ethtool –s ethX [speed 10|100|1000]\ //设置网口速率10/100/1000M
[duplex half|full]\ //设置网口半/全双工
[autoneg on|off]\ //设置网口是否自协商
[port tp|aui|bnc|mii]\ //设置网口类型
mii-tool
# mii-tool -F media ethX
media: 1000baseTx-HD, 1000baseTx-FD,
100baseT4, 100baseTx-FD, 100baseTx-HD,
10baseT-FD, 10baseT-HD,
(to advertise both HD and FD) 1000baseTx, 100baseTx, 10baseT
# mii-tool -r ethX //恢复自适应工作模式
➜ ~ ethtool enp4s0
Settings for enp4s0:
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
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
MDI-X: off (auto)
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
Speed 工作速率100M
Auto-negotiation自适应