网络测速工具

一、Speedtest测试外网网速

Speedtest是用来测试网络性能的开源软件,在Linux下面安装Speedtest可以用来测试网络出口的上传和下载速度,帮助排查网络方面导致的故障。

官网:

Github链接:https://github.com/sivel/speedtest-cli

Speendtest.net官网:http://www.speedtest.net/

windows直接点击网页测试即可。

1. 安装

1.1 pip安装

speedtest是用python写的,没使用过pip的需要先安装pip,

pip安装:https://pip.pypa.io/en/stable/installing/

#开启epel源

yum install python-pip –y

安装speedtest-cli

pip install speedtest-cli

安装完成测试

which speedtest-cli | bash

网络测速工具_第1张图片

1.2 github安装

pip install git+https://github.com/sivel/speedtest-cli.git

或者

git clone https://github.com/sivel/speedtest-cli.git

python speedtest-cli/setup.py install

1.3 shell安装

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py

chmod +x speedtest-cli

./speedtest-cli

2. speedtest-cli使用

speedtest-cli -h

speedtest-cli --share  生成一张分享图片

网络测速工具_第2张图片
网络测速工具_第3张图片

speedtest-cli --list

二、iperf/iperf3测试服务器间网速(支持windows和linux)

iperf命令是一个网络性能测试工具。iperf可以测试TCP和UDP带宽质量。iperf可以测量最大TCP带宽,具有多种参数和UDP特性。iperf可以报告带宽,延迟抖动和数据包丢失。利用iperf这一特性,可以用来测试一些网络设备如路由器,防火墙,交换机等的性能。

Linux:

1.安装

1.1  用yum软件仓库安装

  yum -y install  epel-release

  iperf安装:yum install iperf -y

  iperf3 安装: yum install iperf3 -y

1.2 下载程序包手工安装方式

下载地址:

https://iperf.fr/download/fedora/iperf3-3.1.3-1.fc24.i686.rpm

rpm -ivh iperf3-3.1.3-1.fc24.i686.rpm(需要处理依赖)

2.使用

参数说明:

-s 以server模式启动。#iperf -s

-c host以client模式启动。host是server端地址。#iperf -c serverip

通用参数:

-f [kmKM] 分别表示以Kbits, Mbits, KBytes, MBytes显示报告,默认以Mbits为单位,#iperf -c 192.168.100.6 -f K

-i sec 以秒为单位显示报告间隔,#iperf -c 192.168.100.6 -i 2

-l 缓冲区大小,默认是8KB,#iperf -c 192.168.100.6 -l 64

-m 显示tcp最大mtu值

-o 将报告和错误信息输出到文件#iperf -c 192.168.100.6 -o ciperflog.txt

-p 指定服务器端使用的端口或客户端所连接的端口#iperf -s -p 5001;iperf -c 192.168.100.55 -p 5001

-u 使用udp协议

-w 指定TCP窗口大小,默认是8KB

-B 绑定一个主机地址或接口(当主机有多个地址或接口时使用该参数)

-C 兼容旧版本(当server端和client端版本不一样时使用)

-M 设定TCP数据包的最大mtu值

-N 设定TCP不延时

-V 传输ipv6数据包

server专用参数:

-D 以服务方式运行。#iperf -s -D

-R 停止iperf服务。针对-D,#iperf -s -R

client端专用参数:

-d 同时进行双向传输测试

-n 指定传输的字节数,#iperf -c 192.168.100.6 -n 1024000

-r 单独进行双向传输测试

-t 测试时间,默认20秒,#iperf -c 192.168.100.6 -t 5

-F 指定需要传输的文件

-T 指定ttl值

UDP模式

服务器端:

iperf3 -u -s

客户端:

iperf3 -u -c 172.168.1.1 -b 100M -t 60

在udp模式下,以100Mbps为数据发送速率,客户端上传带宽测试,测试时间为60秒。

iperf3 -u -c 172.168.1.1 -b 5M -P 30 -t 60

客户端发起30个连接线程,以5Mbps为数据发送速率。

iperf3 -u -c 172.168.1.1 -b 100M -d -t 60

以100M为数据发送速率,进行上下行带宽测试。

TCP模式

服务器端:

iperf3  -s  -p 5002 -d 

客户端:

iperf3 -c 172.168.1.1 -t 60  -p 5002

在tcp模式下,客户端上传带宽测试,测试时间为60秒。

iperf3 -c 172.168.1.1  -P 30 -t 60  -p 5002

客户端发起30个连接线程。

iperf3 -c 172.168.1.1  -d -t 60  -p 5002

进行上下行带宽测试。

WINDOWS:

下载地址:https://iperf.fr/iperf-download.php

网络测速工具_第4张图片

直接将解压出来的iperf3.exe和cygwin1.dll复制到%systemroot%目录即可,然后就可以在cmd中使用。

%SystemRoot% 系统目录,环境变量,可以直接在目录栏输入。

命令参数:

网络测速工具_第5张图片
网络测速工具_第6张图片

测试:

客户端:

iperf3 -c 10.211.55.6 -t 10  -p 5002  (直接连接linux的iperf3 server)

网络测速工具_第7张图片

你可能感兴趣的:(网络测速工具)