今天新拿到瑞芯微RV1126的开发板,是双网口双百兆接口,内存为2G,emmc flash为32G,一开始无法分辨物理接口和系统的eth是对应的,遂想用ethtool工具来查看网速,发现:
ethtool eth0 # 可以正常返回网络相关信息及当前连接速率
root@aioter:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP AUI BNC MII FIBRE ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
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: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: ug
Wake-on: d
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yes
ethtool eth1 # 不能正常显示当前速率,只显示为:
current message level :0x00000007
然后经过查询资料解答为:
因为ethtool
通常用于查询物理网络接口(如以太网接口)的速率和其他属性,而USB转换器通常被视为虚拟接口。
那么如果要查询usb转换后的网速呢?
通过查看sysfs中的信息
ls /sys/class/net/
cat /sys/class/net/<interface_name>/speed
请确保替换命令中的 <interface_name>
为你USB转换的网络适配器的名称。
如果这些方法仍无法解决问题,请检查USB转换器制造商的文档,以确定如何查询其速率信息。