方法1 :
~$ cat /sys/class/net/eno1/speed
1000
方法二: 用ethtool 工具
sw:~$ ethtool eno1
Settings for eno1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s #网速配置
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
本文介绍了通过命令行检查网络速度的两种方法:一是使用`cat`命令查看`sys/class/net/eno1/speed`获取速度信息;二是利用`ethtool`工具详细展示网络接口的设置和状态,包括速度、双工模式、连接类型等。
4452

被折叠的 条评论
为什么被折叠?



