Description |
This article describes how to configure FortiGate as a speed test (iperf) server. |
Scope |
FortiGate v7.0, v7.2, v7.4.0, v7.4.1. |
Solution |
Use the settings below to configure FortiGate as a speed test (iperf) server (This feature does NOT work in v7.4.2+):
config system global set speedtest-server enable end
config system interface edit <interface name> append allowaccess speed-test next end Enabling Speed Test on the interface using the GUI:
Note: FortiGate, as a speed test (Iperf) server, listens on TCP port 5201. Starting from FortiOS 7.4.8, FortiGate, as a speed test (Iperf) server, listens on both UDP and TCP port 5201.
For testing, it is possible to make one FortiGate as Iperf client and another FortiGate as Iperf server. Make 'FGT-A' as an iperf server and 'FGT-B' as an Iperf client.
FGT-A (iPerf Server):
config system global set speedtest-server enable end
config system interface edit "port1" set ip 10.9.1.127 255.255.240.0 set allowaccess ping https ssh http telnet speed-test next end
FGT-B (iPerf Client): From 'FGT-B', run the following command to check traffic test settings. Make sure the port is 5201 and the protocol is TCP:
FortiGate-2000E # diagnose traffictest client-intf port1 FortiGate-2000E # diagnose traffictest server-intf port1 FortiGate-2000E # diagnose traffictest port 5201 FortiGate-2000E # diagnose traffictest show server-intf: port1 client-intf: port1 port: 5201 proto: TCP
Run the following command to initiate the traffic test or speed test:
FortiGate-2000E # diagnose traffictest run -c 10.9.1.127 Connecting to host 10.9.1.127, port 5201 [ 14] local 10.9.0.167 port 1209 connected to 10.9.1.127 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 14] 0.00-1.00 sec 114 MBytes 955 Mbits/sec 23 1.13 MBytes [ 14] 1.00-2.00 sec 112 MBytes 943 Mbits/sec 0 1.25 MBytes [ 14] 2.00-3.00 sec 112 MBytes 939 Mbits/sec 0 1.35 MBytes [ 14] 3.00-4.00 sec 112 MBytes 939 Mbits/sec 0 1.43 MBytes [ 14] 4.00-5.00 sec 113 MBytes 945 Mbits/sec 0 1.48 MBytes [ 14] 5.00-6.00 sec 112 MBytes 941 Mbits/sec 0 1.52 MBytes [ 14] 6.00-7.00 sec 112 MBytes 943 Mbits/sec 0 1.54 MBytes [ 14] 7.00-8.00 sec 112 MBytes 941 Mbits/sec 0 1.55 MBytes [ 14] 8.00-9.00 sec 112 MBytes 940 Mbits/sec 0 1.56 MBytes [ 14] 9.00-10.00 sec 112 MBytes 940 Mbits/sec 0 1.56 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 14] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 23 sender [ 14] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec receiver
iperf Done
Note: Run the following command to collect the reverse traffic speed test (in this case, download speed):
diagnose traffictest run -R -c 10.9.1.127
Run the following command to run iPerf parallel streams. Parallel streams in iPerf helps you measure the true maximum throughput.
diagnose traffictest run -c 10.9.1.127 -P 5 // 5 parallel streams for upload diagnose traffictest run -R -c 10.9.1.127 -P 5 // 5 parallel streams for download
FGT-A: If the sniffer is run on 'FGT-A':
FGT-A # diagnose sniffer packet any "port 5201" 4 0 l interfaces=[any] filters=[port 5201] 2022-12-03 06:57:27.907142 port1 in 10.9.0.167.17680 -> 10.9.1.127.5201: syn 3982763007 2022-12-03 06:57:27.907176 port1 out 10.9.1.127.5201 -> 10.9.0.167.17680: syn 29805291 ack 3982763008 2022-12-03 06:57:27.907228 port1 in 10.9.0.167.17680 -> 10.9.1.127.5201: ack 29805292 2022-12-03 06:57:27.907242 port1 in 10.9.0.167.17680 -> 10.9.1.127.5201: psh 3982763008 ack 29805292 2022-12-03 06:57:27.907248 port1 out 10.9.1.127.5201 -> 10.9.0.167.17680: ack 3982763045
iPerf arguments:
Server or client: -p, --port # server port to listen on/connect to
Server-specific:
Client specific:
-c, --client <host> run in client mode, connecting to <host> In case FortiGate acts as client or server, iperf traffic is handled by CPU. While conducting an iperf test, higher CPU usage may be observed due to softirq.
Error :
FGT A # di traffictest run -c 10.9.1.127
FGT A # diag sniff packet any 'port 5201' 4 0 l
Packet sniffer shows that there is no response from the iPerf server (10.9.1.127). Note:
For details about an issue where iPerf connection cannot be established with a FortiGate acting as a SpeedTest Server, see Technical Tip: Unable to establish an iperf connection with a FortiGate acting as a SpeedTest Server....
Related articles: |
|
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.