[内容] Linux 网卡速率的显示

方法一:通过网卡当前的工作状态得知

# ethtool ens192
Settings for ens192:
        Supported ports: [ TP ]
        Supported link modes:   1000baseT/Full 
                                10000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: No
        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: 10000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: Unknown
        Supports Wake-on: uag
        Wake-on: d
        Link detected: yes

(补充:由上面的输出结果可以得知 ens192 网卡目前工作在 1000baseT/Full 状态)

方法二:通过网卡的型号得知

# lspci -vvv | grep Ethernet
0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
        Subsystem: VMware VMXNET3 Ethernet Controller

(补充:由上面的输出结果可以得知,网卡设备为 VMware VMXNET3 Ethernet Controller (rev 01) ,我们可以在网上搜索此设备名以得知此网卡的速率)