用 iperf3 测局域网传输速度

测出两台机器之间的真实带宽,对比 Wi-Fi 和有线差距。

Linux网络iperf3 网速测试测速局域网低风险
一台机器运行 iperf3 -s 当服务器,另一台运行 iperf3 -c 对方IP,看最后的 Gbits/sec 结果。

01命令

命令
$ iperf3 -s   # on the receiving machine; then: iperf3 -c 192.168.1.20

02作用说明

测速网站没法解释为什么拷贝文件到 NAS 很慢——iperf3 测的是你自己两台机器之间的原始链路速度。一台当服务器(-s),一台当客户端(-c),10 秒的测试会给出持续吞吐量。加 -R 测反方向,Wi-Fi 环境建议加 -P 4 开多个并行流才能跑出真实水平。

03风险

风险低风险
使用条件iperf3 installed on BOTH machines (Debian/Ubuntu: sudo apt install iperf3)
!注意: 两台机器都要装 iperf3,服务器监听 5201 端口——别把 iperf3 -s 一直开着带去公共网络。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • iperf3(1) — manual page
    Arch Linux · community · 2026-09-17
    依据: iperf3 measures bandwidth between two hosts; -R reverses the direction to test download throughput from the server.
  • iperf3(1) — Ubuntu manual page
    Ubuntu · community · 2026-09-17
    依据: iperf3 -s runs a server and iperf3 -c host runs a client that measures achievable TCP/UDP throughput to that host.

最后验证: 2026-09-18 · 分类: 网络

06相关方案