Description
This article describes the Equal Cost Multi-Path (ECMP), which is a mechanism that allows a FortiGate to load-balance routed traffic over multiple gateways.
Just like routes in a routing table, ECMP is considered after policy routing, so any matching policy routes will take precedence over ECMP. When ECMP paths are exceeded, this can cause problems with all routing when a new route is added into the ECMP path.
Scope
Solution
ECMP prerequisites are as follows:
The default setting for the number of max ECMP paths allowed by a FortiGate is 255.
config system settings
set ecmp-max-paths <number of paths> <----- Default is 255.
end
The default setting of 255 is also the maximum value that can be configured. This is a hard limit and can not be increased. FortiGate does not support more than 255 ECMP paths.
Setting ecmp-max-paths to the lowest value of 1 is equivalent to disabling ECMP.
To configure the ECMP algorithm from the CLI:
config system settings
set v4-ecmp-mode {source-ip-based* | weight-based | usage-based | source-dest-ip-based}
end
ECMP mode can be adjusted for each VDOM.
The following table summarizes the different load-balancing algorithms supported by each:
Related articles:
Technical Tip: ECMP – Load balancing algorithms for IPv4 and IPv6
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.