iperf Command Examples in Linux

The iperf project is an open source project that provides a benchmarking tool to measure TCP and UDP bandwidth performance. It allows you to tune various parameters. The iperf tool reports bandwidth, delay jitter, and datagram loss.

A basic test is as follows:

1. On the server, run:

# iperf -s

2. On the client, run:

# iperf -c {server address}

3. Examine the results that appear.

You can tune many parameters of iperf, like these:

  • –u: For using a UDP socket.
  • -t: For using a different time interval in seconds instead of the default of 10 seconds.
  • -T: Sets a TTL for multicast (the default is 1).
  • -B: Bind to a host, an interface, or a multicast address.

iperf Command Examples

1. Run on server:

# iperf -s

2. Run on server using UDP mode and set server port to listen on 5001:

# iperf -u -s -p 5001

3. Run on client:

# iperf -c server_address

4. Run on client every 2 seconds:

# iperf -c server_address -i 2

5. Run on client with 5 parallel threads:

# iperf -c server_address -P 5

6. Run on client using UDP mode:

# iperf -u -c server_address -p 5001

Conclusion

The iperf command is used to test the maximum throughput an interface will support. The utility must be installed on both endpoint systems. One system is designated as a “server” and the other as a “client.” It is the iperf client that is getting tested. You can use this command to ensure that throughput is meeting your expectations.

Related Post