2017-12-01 回答
使用ethtool命令。
ethtool是linux下用于查询及设置网卡参数的命令。
举例:
[root@hvrhub ~]# 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: yes
speed: 100mb/s ------------------------------------>网卡速度
duplex: full
port: mii
phyad: 0
transceiver: internal
auto-negotiation: on
supports wake-on: pumbg
wake-on: g
current message level: 0x00000033 (51)
link detected: yes
详细参数参考:(//后面是注释,是原文的译文)
ethtool 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]\ //设置网口类型