Install iperf3
sudo apt install iperf3 # Debian and Ubuntu
sudo dnf install iperf3 # AlmaLinux and Rocky LinuxInstall it on both machines. The Debian and Ubuntu package may ask whether to start iperf3 as a daemon automatically; the default answer is no, which is right for one-off tests, since you start it by hand when needed.
Test only between machines you control, such as two of your own servers, or your server and your own computer. Sending heavy traffic to other people's machines is not acceptable use.
Open the Port Only for the Test
iperf3 listens on port 5201. Open it on the server side for the other machine's address only, and close it when you are done. In the examples, 198.51.100.20 is the client.
# ufw (Debian and Ubuntu)
sudo ufw allow from 198.51.100.20 to any port 5201
sudo ufw delete allow from 198.51.100.20 to any port 5201
# firewalld (AlmaLinux and Rocky Linux), runtime only
sudo firewall-cmd --add-rich-rule='rule family="ipv4" source address="198.51.100.20" port port="5201" protocol="tcp" accept'
sudo firewall-cmd --reloadThe ufw rule names no protocol, so it covers both TCP and UDP; the second ufw line removes it. Without --permanent, the firewalld rule disappears at the next reload, which the second firewalld command does; a reload also drops any other runtime-only changes. A UDP test still uses TCP port 5201 for its control connection, so for firewalld add a second rule with protocol="udp".
Run the Server and the Client
# on the machine that receives (203.0.113.10)
iperf3 -s
# on the other machine
iperf3 -c 203.0.113.10The server waits until you press Ctrl+C; -1 makes it exit after one test. By default the client sends TCP data to the server for 10 seconds, so the result is the client's upload speed toward the server.
Read the Results
The client prints one line per second, then two summary lines marked sender and receiver. The receiver figure is the one that counts: it is what arrived. The Bitrate column is in Mbits/sec or Gbits/sec, bits not bytes. The Retr column counts TCP retransmissions; many retransmissions mean packet loss or congestion on the path.
Useful Options
| Option | What it does |
|---|---|
-R | Reverse: the server sends. |
-P 4 | Four parallel streams. |
-t 30 | Runs 30 seconds; default 10. |
-u -b 100M | UDP at 100 Mbit/s. |
-p 5202 | Uses another port. |
-4 / -6 | IPv4 or IPv6 only. |
Run the test with and without -R to see both directions; they are often different. A single TCP stream over a long distance is limited by latency, so compare one stream with -P 4: if four streams give much more in total, the path is fine and the single connection is the limit.
UDP Tests
iperf3 -c 203.0.113.10 -u -b 100MUDP has no congestion control, so iperf3 sends at the rate you set with -b; without it, UDP tests run at 1 Mbit/s. The summary reports jitter and lost datagrams. Loss that rises as you raise -b shows where the path or one of the hosts runs out of capacity. UDP tests suit voice and streaming workloads.
What Affects the Result
- Both ends: the slower machine, its CPU, and its network interface set the ceiling.
- The path: every link between the two machines, including your own office or home connection.
- Distance: higher latency lowers single-stream TCP throughput.
- Time of day: shared links are busier at peak hours; repeat tests at different times.
A low figure says that something on the path is limited, not where. To find loss along the path, use traceroute and mtr; for a quick latency check, ping; and for testing a provider's network before you have a server there, a looking glass.
Clean Up
Stop the server with Ctrl+C and remove the firewall rule. A forgotten iperf3 server with an open port lets anyone who finds it use your bandwidth.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations