作者:E4b9a6, 创建:2022-04-19, 字数:1422, 已阅:128, 最后更新:2022-04-19
iperf 程序是一个网络性能测试工具,通常可以用于测试网络设备之间网络速度,支持UDP/TCP与IPv4/IPv6,在Ubuntu2204中安装iperf
下面以A机器(192.168.1.1)到B机器(192.168.1.2)为例,在A/B机器上安装iperf
sudo apt install -y iperf
在A机器上开启iperf服务端
iperf -s -p 55201
常用参数
在B机器上连接A机器测试速度
iperf -c 192.168.1.1 -t 30 -p 55201
常用参数
测试结果输出如下
➜ ~ iperf -c 192.168.1.1 -t 30 -p 55201
---------------------------------------------------------Client connecting to 192.168.1.1, TCP port 55201
TCP window size: 416 KByte (WARNING: requested 1.91 MByte)
---------------------------------------------------------[ 3] local 192.168.1.2 port 50038 connected with 192.168.1.1 port 55201
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 892 KBytes 7.31 Mbits/sec
[ 3] 1.0- 2.0 sec 1.12 MBytes 9.44 Mbits/sec
[ 3] 2.0- 3.0 sec 1.62 MBytes 13.6 Mbits/sec
[ 3] 3.0- 4.0 sec 1.50 MBytes 12.6 Mbits/sec
[ 3] 4.0- 5.0 sec 2.12 MBytes 17.8 Mbits/sec
[ 3] 5.0- 6.0 sec 2.25 MBytes 18.9 Mbits/sec
...
[ 3] 24.0-25.0 sec 3.00 MBytes 25.2 Mbits/sec
[ 3] 25.0-26.0 sec 2.75 MBytes 23.1 Mbits/sec
[ 3] 26.0-27.0 sec 2.88 MBytes 24.1 Mbits/sec
[ 3] 27.0-28.0 sec 2.50 MBytes 21.0 Mbits/sec
[ 3] 28.0-29.0 sec 2.25 MBytes 18.9 Mbits/sec
[ 3] 29.0-30.0 sec 3.00 MBytes 25.2 Mbits/sec
[ 3] 0.0-30.1 sec 87.7 MBytes 24.4 Mbits/sec