大家好,欢迎来到IT知识分享网。
目录
一、linux部署iperf3
cenosa安装命令:
sudo yum install iperf3ubuntu安装命令:
sudo apt-get install iperf3
二、服务端起iperf服务
iperf3 -s -i 1
# 作为服务端运行,报告回显间隔时间1siperf3 -s -D
# 作为服务端运行,后台运行,默认端口5201
iperf3 -s -i 1 -p 5202
# 作为服务端运行,端口5202,报告回显间隔时间1s
配置服务配置
1、创建配置文件,文件名为iperf3.service:命令: vim /usr/lib/systemd/system/iperf3.service
2、把下面文件内容编写在iperf3.service文件中
1 [Unit] 2 Description=iperf3 service 3 After=network.target 4 5 [Service] 6 Type=forking 7 ExecStart=/usr/bin/iperf3 -s -D 8 ExecReload=/bin/kill -s HUP $MAINPID 9 ExecStop=/bin/kill -s QUIT $MAINPID 10 PrivateTmp=true 11 12 [Install] 13 WantedBy=multi-user.target
文件参数介绍
[Unit]:服务的说明 Description:描述服务 After:描述服务类别 [Service] 服务运行参数的设置 Type=forking 后台运行的形式 ExecStart 服务的具体运行命令 ExecReload 重启命令 ExecStop 停止命令 PrivateTmp=True 给服务分配独立的临时空间 注意:启动、重启、停止命令全部要求使用绝对路径 [Install] 服务安装的相关设置,可设置为多用户 其中ExecStart=/usr/bin/iperf3 -s -D 这一行中的-D参数必须添加,代表进程守护方式运行,可以不卡光标行
3、刷新iperf3.service 配置信息,命令:systemctl daemon-reload
4、设置开机启动,命令:systemctl enable iperf3.service
如果返回类似“Created symlink from /etc/systemd/system/multi-user.target.wants/iperf3.service to /usr/lib/systemd/system/iperf3.service.”的消息,代表注册成功!
相关命令 systemctl is-enabled iperf3.service #查询服务是否开机启动 systemctl enable iperf3.service #开机运行服务 systemctl disable iperf3.service #取消开机运行 systemctl start iperf3.service #启动服务 systemctl stop iperf3.service #停止服务 systemctl restart iperf3.service #重启服务 systemctl reload iperf3.service #重新加载服务配置文件 systemctl status iperf3.service #查询服务运行状态 systemctl --failed #显示启动失败的服务
三、客户端连接打iperf流
linux打流
iperf3 -c 10.107.68.25 -i 1 -p 5202 -b 10m -t 100
用tcp打10m带宽的流量,1s回显,打100s
-c 192.168.2.1
:指定iperf3客户端连接的服务器的IP地址为192.168.2.1。-p 9904
:指定iperf3客户端连接的服务器的端口号为9904。-P 100
:指定iperf3客户端使用100个并发连接进行测试。-t 10000
:指定iperf3客户端进行测试的时间为10000秒(约2小时46分钟)。-u
:指定iperf3客户端使用UDP协议进行测试。-b 100k
:指定iperf3客户端使用的带宽为100kbit/s(约12.5KB/s)。
window打流
iPerf – Download iPerf3 and original iPerf pre-compiled binaries
根据自身操作系统位数选择,不能确定的下载32 bits
,64 bits兼容32 bits,下载后解压
适用linux一样的参数
C:\Users\knight\Downloads\iperf3.1.1_64>iperf3.exe -c 10.107.68.25 -i 1 -p 5202 -b 10m -t 10
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/152986.html