Skip to main content
lestopace
Staff
Staff
September 9, 2022

Technical Tip: Setting up iperf server and client

  • September 9, 2022
  • 0 replies
  • 23930 views
Description

This article describes how to set up iPerf server and client on both Windows and Linux machines.

Scope

FortiGate, Windows 10, and CentOS have been used.

Solution

Installing iPerf on a Windows machine.

Download the iPerf3 installer from the iPerf download page and extract it to a folder.

 

lestopace_0-1662688493475.png

lestopace_1-1662688604651.png

 

Installing iPerf in a Linux Machine.

Execute the yum install iperf3 command:

 

lestopace_3-1662688797224.png

 

Windows as an iPerf Server.

  1. Open a command prompt, then navigate to the iperf folder location:

 

lestopace_4-1662688953298.png

 

  1. Run the command: iperf3.exe -s.

 

lestopace_5-1662689020361.pnglestopace_6-1662689089390.png

 

In order to receive the output above, another device should be configured as an iPerf client. For a FortiGate configured as an iPerf client, the commands that should be run on the FortiGate are provided in the section at the end of this document titled 'FortiGate as an iPerf client'.

 

Note: Sometimes, the local Windows firewall blocks the connection to port 5201. In these cases, it is necessary to disable the local firewall or create a rule to allow the connection.

 

Windows as an iPerf client.

  1. Open a command prompt, then navigate to the iperf folder location:

 

lestopace_7-1662689195506.png

 

  1. Run the command: iperf3.exe -c 161.142.100.30.

Where the IP address set is the iperf server's.

 

lestopace_8-1662689329430.png

 

Linux as an iPerf server.

Open a terminal and run the command: iperf3 -s.

 

lestopace_10-1662689571665.pnglestopace_11-1662690102754.png

 

Linux as an iPerf client.

Open a terminal and run the command: iperf3 -c 192.168.100.253.

 

lestopace_12-1662690343211.png

 

It is possible to change protocol, ports, and other settings of iPerf.

 

For more information and other functionalities of iPerf:

iPerf - The ultimate speed test tool for TCP, UDP and SCTP

 

Note:

FortiGate can be both the iPerf server and the client. However, only FortiGate running FortiOS 7.0.0 and above can be the iPerf server. To set up the FortiGate as an iPerf server, see Troubleshooting Tip: Configure FortiGate as speed test (iperf) server. FortiGate running as an iPerf server only listens on TCP port 5201.

 

Related articles:

Technical Tip: Use cases for the diagnose traffictest command

Technical Tip: Explaining 'diagnose traffictest' command limitation on FortiOS

 

FortiGate as an iPerf client:

 

lestopace_13-1662690938257.png

 

It is possible to run iPerf3 against the iPerf3 server IP. Define the iPerf3 port running on the iPerf3 server and define a FortiGate interface, for instance, port1, which in this example is the WAN port going to the Internet:

 

diagnose traffictest client-intf port1

diagnose traffictest port  5201

diagnose traffictest run -c <iperf-server-ip>

 

Options to use as iPerf-Client:

 

iPerfClient.jpg

 

Example:

Changing the Port (-p):

 

iperf3 -s -p 9000

iperf3 -c [server-ip] -p 9000

 

Uses a custom port when firewalls block the default 5201. Both server and client must use the same port.

Running a Test in Reverse (-R):

iperf3 -c [server-ip] -R

 

Flips the direction so the server sends data to the client. Handy for testing download performance instead of upload.

 

Using Parallel Streams for Higher Performance Tests (-P):

 

iperf3 -c [server-ip] -P 4

 

Creates 4 parallel connections to fully utilize high-speed links. Essential for 10Gbps+ networks where single streams hit limits.

 

Testing UDP Bandwidth (-u).

 

iperf3 -c [server-ip] -u -b 100M

 

Switches to UDP testing for streaming applications. UDP doesn’t automatically adjust like TCP. Specify the target bandwidth wants to be tested.

 

External resources:

Publicly Available iPerf3 Servers: IPERF3 Server List.

 

Note:

The iPerf/iPerf3 servers are external services and are not operated or endorsed by Fortinet.