ubuntu 安装 iperf3.9

iperf的github

https://github.com/esnet/iperf/releases

解压

sudo tar -zvxf iperf-3.6.tar.gz

进入目录,编译

cd iperf-3.9
sudo ./configure

安装

sudo make 
sudo make install

报错

iperf3: error while loading shared libraries: libiperf.so.0: cannot open shared object file: No such file or directory

手动执行

/* 安装动态库后执行sudo /sbin/ldconfig*/

#sudo /sbin/ldconfig

 

可以访问了

# iperf3 -v
iperf 3.6 (cJSON 1.5.2)
Linux JQ-Mac 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing, authentication
# iperf3 --help

 

开启服务

# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

确保服务端开启5201端口

vim /etc/sysconfig/iptables
/etc/init.d/iptables restart

测试访问

# iperf3 -c 192.168.1.200
Connecting to host 192.168.1.200, port 5201
[  5] local 192.168.1.228 port 58092 connected to 192.168.1.200 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.3 MBytes  94.5 Mbits/sec    0   24.0 KBytes       
[  5]   1.00-2.00   sec  11.2 MBytes  94.1 Mbits/sec    0   26.9 KBytes       
[  5]   2.00-3.00   sec  11.2 MBytes  94.1 Mbits/sec    0   28.3 KBytes       
[  5]   3.00-4.00   sec  11.2 MBytes  94.2 Mbits/sec    0   43.8 KBytes       
[  5]   4.00-5.00   sec  11.2 MBytes  94.2 Mbits/sec    0   43.8 KBytes       
[  5]   5.00-6.00   sec  11.2 MBytes  93.7 Mbits/sec    0   43.8 KBytes       
[  5]   6.00-7.00   sec  11.1 MBytes  93.3 Mbits/sec    0   43.8 KBytes       
[  5]   7.00-8.00   sec  11.3 MBytes  94.4 Mbits/sec    0   66.5 KBytes       
[  5]   8.00-9.00   sec  11.3 MBytes  94.8 Mbits/sec    0    100 KBytes       
[  5]   9.00-10.00  sec  11.1 MBytes  93.2 Mbits/sec    0    100 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   112 MBytes  94.0 Mbits/sec    0             sender
[  5]   0.00-10.04  sec   112 MBytes  93.6 Mbits/sec                  receiver

iperf Done.

 附加知识:

ldconfig是一个动态链接库管理命令,其目的为了让动态链接库为系统所共享。

ldconfig的主要用途:

默认搜寻/lilb和/usr/lib,以及配置文件/etc/ld.so.conf内所列的目录下的库文件。

搜索出可共享的动态链接库,库文件的格式为:lib***.so.**,进而创建出动态装入程序(ld.so)所需的连接和缓存文件。

缓存文件默认为/etc/ld.so.cache,该文件保存已排好序的动态链接库名字列表。

ldconfig通常在系统启动时运行,而当用户安装了一个新的动态链接库时,就需要手工运行这个命令。

ldconfig命令参数说明:

1、 -v或–verbose:用此选项时,ldconfig将显示正在扫描的目录及搜索到的动态链接库,还有它所创建的连接的名字.

2、-n :用此选项时,ldconfig仅扫描命令行指定的目录,不扫描默认目录(/lib,/usr/lib),也不扫描配置文件/etc/ld.so.conf所列的目录.

3、-N :此选项指示ldconfig不重建缓存文件(/etc/ld.so.cache).若未用-X选项,ldconfig照常更新文件的连接.

4、-X : 此选项指示ldconfig不更新文件的连接.若未用-N选项,则缓存文件正常更新.

5、-f CONF : 此选项指定动态链接库的配置文件为CONF,系统默认为/etc/ld.so.conf.

6、-C CACHE :此选项指定生成的缓存文件为CACHE,系统默认的是/etc/ld.so.cache,此文件存放已排好序的可共享的动态链接库的列表.

7、-r ROOT :此选项改变应用程序的根目录为ROOT(是调用chroot函数实现的).选择此项时,系统默认的配置文件/etc/ld.so.conf,实际对应的为ROOT/etc/ld.so.conf.如用-r/usr/zzz时,打开配置文件/etc/ld.so.conf时,实际打开的是/usr/zzz/etc/ld.so.conf文件.用此选项,可以大大增加动态链接库管理的灵活性.

8、-l :通常情况下,ldconfig搜索动态链接库时将自动建立动态链接库的连接.选择此项时,将进入专家模式,需要手工设置连接.一般用户不用此项.

9、-p或–print-cache :此选项指示ldconfig打印出当前缓存文件所保存的所有共享库的名字.

10、-c FORMAT 或–format=FORMAT :此选项用于指定缓存文件所使用的格式,共有三种:ld(老格式),new(新格式)和compat(兼容格式,此为默认格式).

11、-V : 此选项打印出ldconfig的版本信息,而后退出.

12、- 或 --help 或–usage : 这三个选项作用相同,都是让ldconfig打印出其帮助信息,而后退出.、

ldconfig需要注意的地方:

1、往/lib和/usr/lib里面加东西,是不用修改/etc/ld.so.conf文件的,但是添加完后需要调用下ldconfig,不然添加的library会找不到。

2、如果添加的library不在/lib和/usr/lib里面的话,就一定要修改/etc/ld.so.conf文件,往该文件追加library所在的路径,然后也需要重新调用下ldconfig命令。比如在安装MySQL的时候,其库文件/usr/local/mysql/lib,就需要追加到/etc/ld.so.conf文件中。命令如下:

# echo "/usr/local/mysql/lib" >>/etc/ld.so.conf
# ldconfig -v | grep mysql

    1
    2

3、如果添加的library不在/lib或/usr/lib下,但是却没有权限操作写/etc/ld.so.conf文件的话,这时就需要往export里写一个全局变量LD_LIBRARY_PATH,就可以了。

果然果然进行sudo ldconfig就可以啦。

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新版本iperf,官网下载直接编译,适合win10系统。 iperf 3.9 (cJSON 1.7.13) CYGWIN_NT-10.0-19041 LAPTOP-4KUBOSU3 3.2.0-340.x86_64 2021-03-29 08:42 UTC x86_64 Optional features available: CPU affinity setting Usage: iperf3 [-s|-c host] [options] iperf3 [-h|--help] [-v|--version] Server or Client: -p, --port # server port to listen on/connect to -f, --format [kmgtKMGT] format to report: Kbits, Mbits, Gbits, Tbits -i, --interval # seconds between periodic throughput reports -F, --file name xmit/recv the specified file -A, --affinity n/n,m set CPU affinity -B, --bind bind to the interface associated with the address -V, --verbose more detailed output -J, --json output in JSON format --logfile f send output to a log file --forceflush force flushing output at every interval --timestamps emit a timestamp at the start of each output line (using optional format string as per strftime(3)) -d, --debug emit debugging output -v, --version show version information and quit -h, --help show this message and quit Server specific: -s, --server run in server mode -D, --daemon run the server as a daemon -I, --pidfile file write PID file -1, --one-off handle one client connection then exit --server-bitrate-limit #[KMG][/#] server's total bit rate limit (default 0 = no limit) (optional slash and number of secs interval for averaging total data rate. Default is 5 seconds) Client specific: -c, --client run in client mode, connecting to -u, --udp use UDP rather than TCP --connect-timeout # timeout for control connection setup (ms) -b, --bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值