使用 iperf3 点对点测速

三葉Leaves Author

如果是测连接公网速度,可以用 [[_posts/Leaves的全栈工程师之路/实用工具/使用 speedtest cli 方便的测速|使用 speedtest cli 方便的测速]]

iperf3 是单独用来点对点测速的。

安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# macOS
brew install iperf3

# Ubuntu / Debian
sudo apt install -y iperf3

# Windows
winget install -e --id ar51an.iPerf3

# Synology DSM x86_64
synogear install
iperf3

# 其他没有包管理器的 LinuxOS,需要 github 网络条件
ARCH="$(uname -m)"; \
case "$ARCH" in \
x86_64) FILE=iperf3-amd64 ;; \
aarch64|arm64) FILE=iperf3-arm64v8 ;; \
armv7l|armv7*) FILE=iperf3-arm32v7 ;; \
armv6l|armv6*) FILE=iperf3-arm32v6 ;; \
i386|i486|i586|i686) FILE=iperf3-i386 ;; \
*) echo "Unsupported architecture: $ARCH"; exit 1 ;; \
esac; \
curl -fL "https://github.com/userdocs/iperf3-static/releases/latest/download/$FILE" \
-o /usr/local/bin/iperf3 && \
chmod +x /usr/local/bin/iperf3 && \
iperf3 --version

高频用法

服务端

1
2
# 启动服务端进程,指定端口号。默认监听 TCP 5201
iperf3 -s -p port

客户端

1
2
3
4
5
6
# -c 表示客户端
# -t 指定测试时间
# -i 指定每隔几秒输出一次
# -P 指定并发数
# -R 指定是否反向(反向后让服务器发数据)
iperf3 -c $server-ip -t 30 -i 1 -p $port -P 4 -R
  • 标题: 使用 iperf3 点对点测速
  • 作者: 三葉Leaves
  • 创建于 : 2026-08-16 00:00:00
  • 更新于 : 2026-09-20 23:26:04
  • 链接: https://blog.oksanye.com/b2cc36f1efac/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
使用 iperf3 点对点测速