nux*_*nux 51
假设您的网卡名称eth0:
您可以通过三个命令验证速度和一些信息:
第一个命令:
dmesg |grep eth0
Run Code Online (Sandbox Code Playgroud)
输出 :

第二个命令:
mii-tool -v eth0
Run Code Online (Sandbox Code Playgroud)
输出 :

FD : 全双工,实现并发发送和接收的逻辑。当您的计算机连接到交换机时,这通常是可取的并启用。
HD:半双工,他的逻辑要求一张卡只能在一个时间点发送或接收。当您的机器连接到集线器时,它会自动协商并使用半双工来避免冲突。
第三个命令:
ethtool eth0
ethtool - Display or change ethernet card settings
Run Code Online (Sandbox Code Playgroud)
安装 ethtool :
sudo apt-get install ethtool
Run Code Online (Sandbox Code Playgroud)
输出 :
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你 。
小智 17
无需解析日志或安装额外工具即可获取接口的链接速度,只需读取其对应的速度sysfs节点,如下:
cat /sys/class/net/<interface>/speed
Run Code Online (Sandbox Code Playgroud)
您的 NIC 名称在哪里,例如 eth0
| 归档时间: |
|
| 查看次数: |
103197 次 |
| 最近记录: |