iPerf3 Q&A(2):在 OpenWrt 上跑服务端和客户端
在练习中成长
不用等读完,先测一下本文用 Q&A 组织;选择题练习/考试在
/quiz/iperf。
Q1. OpenWrt 怎么安装 iPerf3?
opkg update
opkg install iperf3
空间紧张时先看 overlay 剩余空间;不要为了测速把系统盘塞满。
Q2. 服务端和客户端怎么起?
路由器当服务端:
iperf3 -s
PC 当客户端:
iperf3 -c 192.168.1.1 -t 30
反过来(PC 服务端、路由器客户端)也要测,因为 NAT/转发方向不同。
Q3. 防火墙要放行什么?
默认 TCP/UDP 5201。只测 LAN 时,确认流量没有误走 WAN 规则;测 WAN 侧时不要长期暴露 5201。
# 只允许测试机访问路由器 5201(示例)
uci add firewall rule
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].dest_port='5201'
uci set firewall.@rule[-1].proto='tcp udp'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
/etc/init.d/firewall reload
Q4. 怎么绑定指定地址/端口?
iperf3 -s -B 192.168.1.1 -p 5201
iperf3 -c 192.168.1.1 -p 5201
多网口/多 WAN 时,绑定地址能避免测到错误接口。-p 改端口后防火墙也要同步。
Q5. 怎么后台跑服务端?
iperf3 -s -D
-D 让服务端后台运行;测试完记得停掉,别把 5201 长期开着。
排障:
ps | grep iperf3
netstat -lntp | grep 5201
logread | tail
练习/考试(选择题)
本页 5 题已收进 iPerf3 实战 题库:
- 青铜练习(15 题) · 青铜考试(10 题)
- 也可以点文章顶部的“本页练习”。
系列:iPerf3 实战。上一篇:iPerf3 是什么 · 下一篇:结果怎么才可信。
评论 0
还没有评论,来抢沙发~