方法一:通过网卡当前的工作状态得知
4.1 通过 ip 命令查看网卡速率
4.1.1 通过 ip 命令查看所有网卡的速率
# ip link show
4.1.2 通过 ip 命令查看某张网卡的速率
# ip link show ens192
1: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:51:52:a4:fd:2d brd ff:ff:ff:ff:ff:ff
altname enp12s0
(补充:由上面的输出结果可以得知 ens192 网卡目前工作在 1000baseT/Full 状态)
4.2 通过 ethtool 命令查看网卡速率
# 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) ,我们可以在网上搜索此设备名以得知此网卡的速率)
