通过iperf3可以测试客户端到服务器带宽、延时等进而可以判断网络质量、速率等信息。
一、安装iperf3
1、yum安装
yum install -y iperf3
2、其他操作系统可以下载官网的软件包
iperf3下载链接:https://iperf.fr/iperf-download.php
下载完成后可以通“rpm -ivh”进行安装。
二、Linux操作系统测速
1、开启ipert3服务器端
iperf3 -s iperf3 -s -p 2222 #可以指定服务器测试的端口号;
2、客户端测速命令
iperf3 -c 172.16.0.211 #连接测速,默认测的是从客户端到服务端的带宽(服务器接收,客户端发送); iperf3 -R -c 172.16.0.211 #-R 设置服务器发送,客户端接收 iperf3暂不支持全双工测试,有点遗憾 iperf3 -t 60 -c 172.16.0.211 #-t 参数可以置顶测速时间; iperf3 -p 2222 -c 172.16.0.211 #-p 指定测速服务器端口 iperf3 -c 10.99.1.250 -P 10 -t 30 #建议使用该项采用10线程打流,打流时间时间为30S
举个例子:
[root@keep02 ~]# iperf3 -c 10.99.1.250 -P 10 -t 30 Connecting to host 10.99.1.250, port 5201 [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-30.00 sec 9.25 GBytes 2.65 Gbits/sec 0 sender [ 5] 0.00-30.02 sec 9.24 GBytes 2.64 Gbits/sec receiver [ 7] 0.00-30.00 sec 12.4 GBytes 3.55 Gbits/sec 0 sender [ 7] 0.00-30.02 sec 12.4 GBytes 3.55 Gbits/sec receiver [ 9] 0.00-30.00 sec 5.14 GBytes 1.47 Gbits/sec 0 sender [ 9] 0.00-30.02 sec 5.13 GBytes 1.47 Gbits/sec receiver [ 11] 0.00-30.00 sec 5.13 GBytes 1.47 Gbits/sec 0 sender [ 11] 0.00-30.02 sec 5.13 GBytes 1.47 Gbits/sec receiver [ 13] 0.00-30.00 sec 9.19 GBytes 2.63 Gbits/sec 0 sender [ 13] 0.00-30.02 sec 9.18 GBytes 2.63 Gbits/sec receiver [ 15] 0.00-30.00 sec 5.14 GBytes 1.47 Gbits/sec 0 sender [ 15] 0.00-30.02 sec 5.14 GBytes 1.47 Gbits/sec receiver [ 17] 0.00-30.00 sec 5.14 GBytes 1.47 Gbits/sec 0 sender [ 17] 0.00-30.02 sec 5.13 GBytes 1.47 Gbits/sec receiver [ 19] 0.00-30.00 sec 12.1 GBytes 3.48 Gbits/sec 0 sender [ 19] 0.00-30.02 sec 12.1 GBytes 3.47 Gbits/sec receiver [ 21] 0.00-30.00 sec 5.13 GBytes 1.47 Gbits/sec 0 sender [ 21] 0.00-30.02 sec 5.12 GBytes 1.47 Gbits/sec receiver [ 23] 0.00-30.00 sec 5.13 GBytes 1.47 Gbits/sec 0 sender [ 23] 0.00-30.02 sec 5.12 GBytes 1.47 Gbits/sec receiver [SUM] 0.00-30.00 sec 73.8 GBytes 21.1 Gbits/sec 0 sender [SUM] 0.00-30.02 sec 73.7 GBytes 21.1 Gbits/sec receiver
三、Windows操作系统测速
下载windows测速工具,后打开CMD,执行与linux相同的命令即可测速。