iperf3 options and examples: a practical cheat sheet

Updated November 2026

iperf3 has dozens of options, but about twenty cover nearly every real test. This page lists them with a working example for each, checked against the iperf3 manual page for the current 3.22 release.

How options are passed

Almost every option is given on the client. The client sends the test parameters to the server over a separate control connection, so the server usually needs only -s (plus -p if you change the port). Most options have a short and a long form, for example -t and --time. Sizes and rates accept the suffixes K, M, G and T, as in -b 500M or -w 4M.

The cheat sheet

Most useful iperf3 options (client unless stated)
OptionWhat it doesExample
-sRun as server. Listens on TCP port 5201 by default.iperf3 -s
-c hostRun as client and connect to host (name, IPv4 or IPv6 address).iperf3 -c 192.0.2.10
-p nServer port to listen on or connect to (default 5201). Use the same value on both sides.iperf3 -c host -p 5202
-t nTest length in seconds (default 10).iperf3 -c host -t 60
-i nSeconds between interval reports (default 1; 0 turns them off).iperf3 -c host -t 60 -i 5
-P nNumber of parallel streams. From 3.16 each stream has its own thread.iperf3 -c host -P 4
-RReverse: the server sends, the client receives.iperf3 -c host -R
--bidirSend in both directions at the same time.iperf3 -c host --bidir
-uUse UDP for the test data (the control connection stays TCP).iperf3 -c host -u
-b rateTarget bitrate. Default 1 Mbit/s for UDP, unlimited for TCP. Applies per stream with -P. 0 removes the limit.iperf3 -c host -u -b 200M
-l sizeRead/write buffer length. TCP default 128 KB; UDP default based on path MTU, falling back to 1,460 bytes.iperf3 -c host -u -b 50M -l 1200
-w sizeSocket buffer (window) size, used on both client and server.iperf3 -c host -w 8M
-JOutput a JSON document instead of text, printed at the end of the test.iperf3 -c host -J > result.json
--logfile fWrite output to a file instead of the terminal.iperf3 -c host --logfile run1.txt
-O nRun n extra seconds first and leave them out of the results, to skip TCP slow start.iperf3 -c host -t 30 -O 3
-ZZero-copy sending, such as sendfile() instead of write(). Saves sender CPU.iperf3 -c host -Z
-4 / -6Force IPv4 or IPv6 when a name resolves to both.iperf3 -c host.example.net -6
-B addrBind to the interface that owns addr. Works on client and server.iperf3 -c host -B 198.51.100.5
--cport nUse a fixed client port for the data streams (TCP and UDP only) instead of a random one.iperf3 -c host --cport 40000

Useful extras

-D and -1 (server)
-D runs the server in the background as a daemon. -1 handles a single client and then exits, which is handy for one-off tests.
-n and -k
Send a fixed number of bytes (-n 1G) or blocks instead of running for a fixed time. You can use only one of -t, -n and -k.
-f
Fix the units: -f m for Mbit/s, -f g for Gbit/s.
--get-server-output
Shows the server's own report at the end of the client output. It is only available if the test completes.
-C algo
Choose the TCP congestion control algorithm for the test, such as -C bbr (Linux and FreeBSD only, and the algorithm must be available in the kernel).
-M n and -N
Set the TCP maximum segment size, or disable Nagle's algorithm.
-A n
Pin iperf3 to CPU core n (Linux, FreeBSD and Windows). Useful on multi-socket servers.
-T text and --timestamps
Prefix every line with a label or a timestamp, which helps when several tests write to one log.
--forceflush
Flush output every interval, so you see lines immediately when piping to another program.

Examples for common jobs

A clean TCP baseline

iperf3 -c host -t 30 -O 3

Thirty seconds of measurement after three seconds of warm-up. Run it again with -R for the other direction.

Does more streams help?

iperf3 -c host -t 30 -P 1
iperf3 -c host -t 30 -P 8

If eight streams are much faster than one, a single TCP flow is being held back by window size, loss or CPU, not by link capacity.

Machine-readable results

iperf3 -c host -t 20 -J --logfile /var/tmp/iperf-$(date +%F-%H%M).json

Testing through a firewall that allows one port

# server
iperf3 -s -p 8443
# client: fixed source port as well
iperf3 -c host -p 8443 --cport 50000
iperf3 -c 2001:db8::10 -6 -B 2001:db8::5

About -w on Linux. Setting -w fixes the socket buffer and turns the request into a hard limit. Linux doubles the value you ask for (the extra is bookkeeping), and it caps it at net.core.rmem_max and wmem_max. If those maximums are small, a large -w is silently reduced. Usually it is better to leave -w out and let autotuning work; see Linux tuning.

Options that changed meaning

Option lists change between releases. If an option is rejected, check iperf3 --version and iperf3 --help on both machines.

Sources