ifconfig 本身不能用来测速。ifconfig 只能查看网络接口的配置和流量统计(RX/TX 字节数),不具备测速功能。
不过,你可以用它间接估算速率,或者配合其他工具测速。
ifconfig eth0
关注这两行:
RX packets ... bytes ...
TX packets ... bytes ...
ifconfig eth0 | grep 'RX bytes'
示例:
✅ 适合:看当前是否在跑流量 ❌ 不适合:精确测速
speedtest-cli
或新版:
speedtest
安装:
pip install speedtest-cli
服务端:
iperf3 -s
客户端:
iperf3 -c 服务器IP
watch -n 1 ifconfig eth0
或更好用:
iftop
nload
ifconfig ≠ 测速工具speedtest / iperf3如果你告诉我:
我可以给你最合适的测速命令。