How to diagnose network speed with Iperf in Linux
iperf is a tool for performing network throughput measurements. It can test either TCP or UDP throughput. To perform an iperf test the user must establish both a server (to discard traffic) and a client (to generate traffic).
Install Iperf
Ubuntu/Debian
apt-get install iperf
CentOS
yum install iperf3
Arch Linux
pacman -S iperf
Use Iperf
TCP Clients & Servers
- Start server mode on the server you want to test:
iperf -s - On your other machine, connect to one machine and replace it with the server machine IP
-
You will see the following output on the server:
UDP Clients & Servers
-
Start UDP Iperf server
- On your other machine, connect to one machine and replace it with the server machine IP.
The -u option tells Iperf to use a UDP connection. The output is as follows:
- You will see the following output on the server: