> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Test Bandwidth with iperf3 (Linux and Windows)

> Test bandwidth with iperf3: run iperf3 -s on one host and iperf3 -c with -P and -R on the other to measure TCP and UDP throughput to your server.

To test bandwidth with iperf3, install it on two machines, run `iperf3 -s` on one (it listens on TCP port 5201) and `iperf3 -c 203.0.113.10 -P 4` on the other. Add `-R` to test the opposite direction. iperf3 measures throughput between those two hosts only, so pick a second host close to where your users are.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 10 minutes | Ubuntu 22.04/24.04, Debian 12/13, AlmaLinux/Rocky 9/10; Windows with limits | Two machines and port 5201 open on the server side |

## Before you start

* **Throughput** (bandwidth) is how much data per second gets through, shown in Mbits/sec or Gbits/sec. iperf3 measures it between a **server** (which listens) and a **client** (which connects).
* You need a second machine: another server, or your own computer. A test to a public iperf3 server only shows the path to that server.
* Open TCP port 5201 on the machine that runs `iperf3 -s`, and close it again when you finish. See [UFW](https://help.freakhosting.com/portals/other/how-to-set-up-a-firewall-with-ufw.md), [firewalld](https://help.freakhosting.com/portals/other/how-to-set-up-a-firewall-with-firewalld.md) or [Windows Firewall](https://help.freakhosting.com/portals/other/how-to-open-a-port-in-windows-firewall.md).
* Commands use `sudo` for a non-root user. As root, leave it out.

## How to install iperf3

> [tab] Ubuntu / Debian
>
> ```bash theme={null}
> sudo apt update
> sudo apt install iperf3
> ```
>
> If the installer asks **Start Iperf3 as a daemon automatically?**, choose **No** unless you need a permanent test server.

> [tab] AlmaLinux / Rocky
>
> ```bash theme={null}
> sudo dnf install iperf3
> ```

> [tab] Windows
>
> ESnet, who make iperf3, [don't publish Windows builds](https://software.es.net/iperf/obtaining.html) and [don't officially support Windows](https://software.es.net/iperf/faq.html). Third-party builds exist and are linked from that page; not every option works in them. For the most reliable result, run the iperf3 server on a Linux machine.

## How to run an iperf3 test

**1. Open port 5201 on the server**

> [tab] Ubuntu / Debian (UFW)
>
> ```bash theme={null}
> sudo ufw allow 5201/tcp
> ```

> [tab] AlmaLinux / Rocky (firewalld)
>
> ```bash theme={null}
> sudo firewall-cmd --add-port=5201/tcp
> ```
>
> Without `--permanent`, the rule disappears at the next reload or reboot.

> [tab] Windows
>
> ```powershell theme={null}
> New-NetFirewallRule -DisplayName "iperf3 test" -Direction Inbound -Protocol TCP -LocalPort 5201 -Action Allow
> ```

**2. Start the iperf3 server**

On the server:

```bash theme={null}
iperf3 -s
```

It prints `Server listening on 5201 (test #1)` and waits. Add `-1` to exit after one test.

**3. Run the client**

On the other machine, replace the IP with your server's:

```bash theme={null}
iperf3 -c 203.0.113.10 -P 4 -t 30
```

`-P 4` runs four parallel streams and `-t 30` runs for 30 seconds (default 10).

**4. Test the other direction**

```bash theme={null}
iperf3 -c 203.0.113.10 -P 4 -t 30 -R
```

`-R` makes the server send and the client receive. Use `--bidir` to test both directions at once.

**5. Stop and close the port**

Press **Ctrl+C** on the server, then remove the firewall rule (`sudo ufw delete allow 5201/tcp`, or `Remove-NetFirewallRule -DisplayName "iperf3 test"` on Windows).

## How to read the result

```text theme={null}
[ ID] Interval           Transfer     Bitrate         Retr
[SUM]   0.00-30.00  sec  3.28 GBytes   939 Mbits/sec  112             sender
[SUM]   0.00-30.00  sec  3.27 GBytes   937 Mbits/sec                  receiver
```

| Field | Meaning |
| - | - |
| **Bitrate (receiver)** | The throughput that actually arrived. Use this number. |
| **Retr** | TCP retransmissions. Some are normal; very high counts mean loss or congestion on the path. |
| **\[SUM]** | Total of all parallel streams when you use `-P`. |

The result is limited by the slowest part of the path: either machine's network port, the route between them, or CPU on either side.

## Useful iperf3 options

| Option | What it does |
| - | - |
| `-p 5202` | Use another port (on both sides) |
| `-t 30` | Test duration in seconds (default 10) |
| `-P 4` | Parallel streams |
| `-R` | Reverse: server sends to client |
| `--bidir` | Both directions at the same time |
| `-u -b 100M` | UDP test at 100 Mbit/s. UDP defaults to only 1 Mbit/s, so always set `-b` |
| `-4` / `-6` | Force IPv4 or IPv6 |
| `-J` | JSON output for scripts |

A UDP test also reports jitter and lost datagrams, which helps for voice and game traffic:

```bash theme={null}
iperf3 -c 203.0.113.10 -u -b 200M -t 20
```

> [!WARNING]
>
> Don't leave `iperf3 -s` running on a public IP. Anyone who finds the port can use your bandwidth. Stop it and close port 5201 when you're done, and keep heavy tests short: the traffic counts towards your server's usage (see [traffic and bandwidth](https://help.freakhosting.com/portals/vps-panel/understanding-vps-traffic-and-bandwidth.md)).

## Frequently asked questions

### Why is my iperf3 result lower than my port speed?

Distance, the slower of the two connections, CPU limits and TCP tuning all reduce throughput. Try more streams with `-P 8`, and on long paths see [BBR](https://help.freakhosting.com/portals/other/how-to-enable-bbr-tcp-congestion-control.md).

### Why does iperf3 say "unable to connect to server"?

If the message ends in "Connection refused", nothing is listening: check `iperf3 -s` is running. A timeout means a firewall drops the connection: check port 5201 is open on the server's firewall.

### Can iperf3 talk to iperf2?

No. iperf3 isn't backwards compatible with iperf2, so use the same tool on both ends.

### Does iperf3 use more than one CPU core?

From version 3.16, iperf3 runs each stream in its own thread. Older versions use one core for all streams. Check with `iperf3 --version`.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Diagnose network latency](https://help.freakhosting.com/portals/other/how-to-diagnose-network-latency-issues.md)
>
> Find where lag and loss start.

> [card] [Check bandwidth usage](https://help.freakhosting.com/portals/other/how-to-check-bandwidth-usage-on-linux.md)
>
> See live and monthly traffic.

> [card] [Enable BBR](https://help.freakhosting.com/portals/other/how-to-enable-bbr-tcp-congestion-control.md)
>
> Better TCP throughput on long paths.

> [card] [Benchmark your VPS](https://help.freakhosting.com/portals/other/how-to-benchmark-your-vps.md)
>
> CPU, disk and network tests.

***

> [!NOTE]
>
> **Checked against the official [iperf3 documentation](https://software.es.net/iperf/invoking.html) and [FAQ](https://software.es.net/iperf/faq.html)** on 4 November 2026; Linux commands tested on Ubuntu 24.04 LTS (iperf 3.16). Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.