Testing network bandwidth with Iperf

Iperf — cross-platform console client-server program – a TCP and UDP traffic generator for testing network bandwidth.

The installation command in Ubuntu:

sudo apt-get install iperf

To display help in the console, type:

iperf --help

Let’s see what version was installed:

iperf -v

To test network bandwidth, the following commands are executed:

On server:

iperf -s -i1

On the client:

iperf -c HOST -t 5

On the client from Windows, you can run the bat file, the pause command will prevent the window from closing:

iperf -c HOST -t 5

You can download the version for Windows on the website iperf.fr
If iperf 2 is installed on the server, then the same is downloaded for Windows. The client of the third version did not connect to the server on the second one.

I’ll describe some startup options:
-i (statistics update interval)
-s (running in server mode)
-c (running in client mode)
-p (manual port specification, standard 5001 TCP)
-D (start the server as a daemon)
-t (test time, standard 10 seconds)

Suppose we run the server as a daemon:

iperf -s -D

Press Ctrl+C to exit, the server will work in the background to complete it, see PID commands and finish:

sudo ps ax | grep iperf
sudo netstat -tulpn | grep :5001
sudo kill -9 PID

See also:
IPTables rules for Iperf

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a comment

Leave a Reply