linux查看网卡速度和模式调整

[root@c02b03 ~]#  ethtool eth0
Settings for eth0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  1000baseT/Full 
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000003 (3)
        Link detected: no
[root@c02b03 ~]#  ethtool eth1
Settings for eth1:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  1000baseT/Full 
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000003 (3)
        Link detected: yes


或者老的mii-tool命令(但是该命令似乎只能识别100M及以下网卡)亦可。

其中, Duplex: Full表示全双工(FD),half表示半双工(HD),Auto-negotiation 后边表示是否自动协商

可以通过修改/etc/sysconfig/network-scripts/ifcfg-eth0文件中的

ETHTOOL_OPTS="speed 100 duplex full autoneg off"

参数进行设置,使用ifup和ifdown来测试



你可能感兴趣的:(linux查看网卡速度和模式调整)