ubuntu 安装 iperf
<p>iperf的github</p><pre><code>https://github.com/esnet/iperf/releases
</code></pre>
<p>解压</p>
<pre><code>sudo tar -zvxf iperf-3.6.tar.gz -C /usr/local
</code></pre>
<p>进入目录,编译</p>
<pre><code>sudo ./configure
</code></pre>
<p>安装</p>
<pre><code>sudo make
sudo make install
</code></pre>
<p>报错</p>
<pre><code>iperf3: error while loading shared libraries: libiperf.so.0: cannot open shared object file: No such file or directory
</code></pre>
<p>手动执行</p>
<pre><code>sudo /sbin/ldconfig
</code></pre>
<p>可以访问了</p>
<pre><code># 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
</code></pre>
<p>开启服务</p>
<pre><code># iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
</code></pre>
<p>确保服务端开启5201端口</p>
<pre><code>vim /etc/sysconfig/iptables
/etc/init.d/iptables restart
</code></pre>
<p>测试访问</p>
<pre><code># iperf3 -c 192.168.1.200
Connecting to host 192.168.1.200, port 5201
local 192.168.1.228 port 58092 connected to 192.168.1.200 port 5201
[ ID] Interval Transfer Bitrate RetrCwnd
0.00-1.00 sec11.3 MBytes94.5 Mbits/sec 0 24.0 KBytes
1.00-2.00 sec11.2 MBytes94.1 Mbits/sec 0 26.9 KBytes
2.00-3.00 sec11.2 MBytes94.1 Mbits/sec 0 28.3 KBytes
3.00-4.00 sec11.2 MBytes94.2 Mbits/sec 0 43.8 KBytes
4.00-5.00 sec11.2 MBytes94.2 Mbits/sec 0 43.8 KBytes
5.00-6.00 sec11.2 MBytes93.7 Mbits/sec 0 43.8 KBytes
6.00-7.00 sec11.1 MBytes93.3 Mbits/sec 0 43.8 KBytes
7.00-8.00 sec11.3 MBytes94.4 Mbits/sec 0 66.5 KBytes
8.00-9.00 sec11.3 MBytes94.8 Mbits/sec 0 100 KBytes
9.00-10.00sec11.1 MBytes93.2 Mbits/sec 0 100 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
0.00-10.00sec 112 MBytes94.0 Mbits/sec 0 sender
0.00-10.04sec 112 MBytes93.6 Mbits/sec receiver
iperf Done.
</code></pre>
<p>比较操蛋的是,很少有服务器开启5201端口。</p><br><br>
来源:https://www.cnblogs.com/jiqing9006/p/10966578.html
頁:
[1]