Checking connection speed with iperf

Install the iperf or iperf3 utility on the server 

apt install iperf3 // for Debian/Ubuntu
yum install iperf3 // for RedHat/CentOS

To check the connection, run the utility with the -c switch for client mode and specify the address of the server with which the connection is checked, for example:

iperf3 -c bouygues.iperf.fr
Connecting to host bouygues.iperf.fr, port 5201
[ 4] local 192.168.0.47 port 56396 connected to 89.84.1.222 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 608 KBytes 4.98 Mbits/sec 0 48.1 KBytes 
[ 4] 1.00-2.00 sec 1.24 MBytes 10.4 Mbits/sec 0 80.6 KBytes 
[ 4] 2.00-3.00 sec 1.62 MBytes 13.6 Mbits/sec 0 120 KBytes 
[ 4] 3.00-4.00 sec 2.11 MBytes 17.7 Mbits/sec 0 151 KBytes 
[ 4] 4.00-5.00 sec 2.92 MBytes 24.5 Mbits/sec 0 173 KBytes 
[ 4] 5.00-6.00 sec 2.98 MBytes 25.0 Mbits/sec 0 191 KBytes 
[ 4] 6.00-7.00 sec 3.42 MBytes 28.7 Mbits/sec 0 212 KBytes 
[ 4] 7.00-8.00 sec 1.30 MBytes 10.9 Mbits/sec 0 212 KBytes 
[ 4] 8.00-9.00 sec 445 KBytes 3.65 Mbits/sec 1 212 KBytes 
[ 4] 9.00-10.00 sec 891 KBytes 7.30 Mbits/sec 0 212 KBytes 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 17.5 MBytes 14.7 Mbits/sec 1 sender
[ 4] 0.00-10.00 sec 16.7 MBytes 14.0 Mbits/sec receiver

In this example, the public server iperf was used, they are available for cases when there is no second server with which you should check the connection speed.

The list of public servers can be found at this link.

If you need to check the connection speed with the server itself, you just need to run iperf3 in server mode.

  • First, you need to allow connections to port 5201 of the server:
firewall-cmd --permanent --add-port=5201/tcp
firewall-cmd --permanent --add-port=5201/udp
firewall-cmd --reload
  • After - we launch the utility itself, in case of successful launch we will see the following entry.
iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
  • After that, you can check the connection speed, as shown earlier.