Linux command
iperf3 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Start a server
iperf3 -s
Connect to a server
iperf3 -c [server_ip]
Run for a specific duration
iperf3 -c [server_ip] -t [30]
Test upload speed
iperf3 -c [server_ip] -R
Test UDP
iperf3 -c [server_ip] -u
Use multiple parallel streams
iperf3 -c [server_ip] -P [4]
Set target bandwidth
iperf3 -c [server_ip] -u -b [100M]
Output results in JSON
iperf3 -c [server_ip] -J
说明
iperf3 is a network throughput testing tool that measures maximum TCP and UDP bandwidth performance. It creates data streams between a server and client to measure achievable network speed, useful for troubleshooting, benchmarking, and capacity planning. A typical test requires running iperf3 in server mode on one machine and client mode on another. The client initiates the test, and both sides report the measured throughput. By default, tests run for 10 seconds with TCP. TCP mode measures bulk transfer speed, limited by congestion control, RTT, and link capacity. UDP mode with -b sets a target send rate, useful for testing whether a network can sustain specific bandwidth without packet loss. Parallel streams (-P) can reveal aggregation limits and help saturate high-bandwidth links where a single stream can't achieve full capacity. The reverse mode (-R) tests upload by having the server send to the client. JSON output enables automated testing and integration with monitoring systems. Server can run as a daemon for ongoing availability.
参数
- -s, --server
- Run in server mode.
- -c, --client _host_
- Run as client, connect to server.
- -p, --port _port_
- Server port (default: 5201).
- -t, --time _n_
- Test duration in seconds (default: 10).
- -P, --parallel _n_
- Number of parallel streams.
- -u, --udp
- Use UDP instead of TCP.
- -b, --bandwidth _nKMG_
- Target bandwidth (UDP default: 1 Mbit/s).
- -R, --reverse
- Run in reverse mode (server sends, client receives).
- --bidir
- Bidirectional test simultaneously.
- -i, --interval _n_
- Seconds between periodic reports.
- -n, --bytes _nKMG_
- Number of bytes to transmit.
- -J, --json
- Output in JSON format.
- -l, --length _nKMG_
- Buffer/packet size.
- -w, --window _nKMG_
- Socket buffer size.
- -B, --bind _addr_
- Bind to specific address.
- -4, -6
- Use IPv4/IPv6 only.
- -D, --daemon
- Run server as daemon.
- --logfile _file_
- Write output to file.
FAQ
What is the iperf3 command used for?
iperf3 is a network throughput testing tool that measures maximum TCP and UDP bandwidth performance. It creates data streams between a server and client to measure achievable network speed, useful for troubleshooting, benchmarking, and capacity planning. A typical test requires running iperf3 in server mode on one machine and client mode on another. The client initiates the test, and both sides report the measured throughput. By default, tests run for 10 seconds with TCP. TCP mode measures bulk transfer speed, limited by congestion control, RTT, and link capacity. UDP mode with -b sets a target send rate, useful for testing whether a network can sustain specific bandwidth without packet loss. Parallel streams (-P) can reveal aggregation limits and help saturate high-bandwidth links where a single stream can't achieve full capacity. The reverse mode (-R) tests upload by having the server send to the client. JSON output enables automated testing and integration with monitoring systems. Server can run as a daemon for ongoing availability.
How do I run a basic iperf3 example?
Run `iperf3 -s` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s, --server do in iperf3?
Run in server mode.