FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
enguyen3467
Staff
Staff
Article Id 304409

Description

This article describes how to set up a custom iPerf server to test connection speed.

Scope

FortiGate, Windows, Linux.

Solution

Even though there are public iPerf servers that can be used to test internet speed, these servers are often overloaded with requests to test speed from the around the world. As a result, the following error is often seen when performing a speed test on a Gate:

 

iperf3: error - unable to connect to server: Device or resource busy
iperf3: interrupt - the server has terminated

 

To tackle this, FortiGate can be configured as an iPerf server, as shown in Troubleshooting Tip: Configure FortiGate as speed ... - Fortinet Community. However, this feature is only available from 7.0.0 onward and FortiGate only listens for the iPerf service on TCP port 5201, which cannot facilitate any tests using TCP on other ports or using UDP as the protocol 

 

First, set up a test machine as an iPerf server by following the instructions in this article: Technical Tip: Setting up iperf server and client - Fortinet Community.

 

To eliminate any in-between devices that may interfere with the speed test result, the recommendation is to plug the test machine directly to the physical port on the FortiGate.

 

Set up the topology as follows:

 

Internet ---- (WAN) FortiGate (FGT)  (LAN) ---- iPerf server

 

On the FortiGate, configure the VIP object mapping the external IP address (whether the WAN's IP of the FortiGate or any unused IP provided by the ISP) to the iPerf server's internal IP address. After that, configure a WAN to LAN policy with the source set to 'all', destination set to the VIP object, and (optionally) service set to the iPerf service (TCP and UDP port 5201 - 5209).

 

For the purpose of demonstration in this article, the topology will be followed and one Windows 10 host will be configured to act as the iPerf server in VLAN 101, with another Windows 10 machine acting as an external connection from the Internet:

 

Internet host (10.9.32.3) ---- (port4 - WAN - 10.9.32.7) FGT (port2 - LAN - 192.168.101.254) ---- iPerf server (192.168.101.5)

 

On the iPerf server created by following the instructions in Technical Tip: Setting up iperf server and client - Fortinet Community, enter 'iperf3.exe -S' in the iPerf directory and check to make sure that the Windows firewall allows iPerf to run on all types of network as needed.

 

Stephen_G_0-1710340726450.png

 

 

On the FortiGate, create a custom server for iPerf:

 

Stephen_G_1-1710340726453.png

 

 

Create a VIP object mapping port4's IP address of the FortiGate to port2's IP address of the iPerf (optionally, enable an optional filter to instruct the FortiGate on which condition DNAT translation should be used during):

 

Stephen_G_2-1710340726455.png

 

 

Create a firewall policy from WAN to LAN to allow the Internet host to be able to access the iPerf server:

 

Stephen_G_3-1710340726456.png

 

 

While performing the iPerf test on the internet host, make sure to access the iPerf server using the EXTERNAL IP address and not the internal one:

 

Stephen_G_4-1710340726460.png

 

 

On the iPerf server, note the incoming traffic:

 

Stephen_G_5-1710340726466.png

 

 

Here on the FortiGate, it can be verified that the traffic with the VIP object has been hit:

 

Stephen_G_6-1710340726468.png

 

 

Note that the test can still be affected by the following elements:

  • ISP bandwidth of the Internet host machine.
  • Bandwidth of the NIC on both the client and server.
  • Bandwidth of the NIC on the FortiGate (this is where troubleshooting is performed for the issue on the FortiGate).

Related articles: