Chapter 2 Advanced Routing for FortiOS 5.0 : Advanced Static Routing : Advanced static example: ECMP failover and load balancing : Equal-Cost Multi-Path (ECMP)
  
Equal-Cost Multi-Path (ECMP)
FortiOS uses equal-cost multi-path (ECMP) to distribute traffic to the same destination such as the Internet or another network. Using ECMP you can add multiple routes to the destination and give each of those routes the same distance and priority.
 
 
If multiple routes to the same destination have the same priority but different distances, the route with the lowest distance is used. If multiple routes to the same destination have the same distance but different priorities, the route with the lowest priority is used. Distance takes precedence over priority. If multiple routes to the same destination have different distances and different priorities, the route with the lowest distance is always used even if it has the highest priority.
If more than one ECMP route is available, you can configure how the FortiGate unit selects the route to be used for a communication session. If only one ECMP route is available (for example, because an interface cannot process traffic because interface status detection does not receive a reply from the configured server) then all traffic uses this route.
Previous versions of FortiOS provided source IP-based load balancing for ECMP routes, but now FortiOS includes three configuration options for ECMP route failover and load balancing:
Source based (also called source IP based)
The FortiGate unit load balances sessions among ECMP routes based on the source IP address of the sessions to be load balanced. This is the default load balancing method. No configuration changes are required to support source IP load balancing.
Weighted Load Balance (also called weight-based)
The FortiGate unit load balances sessions among ECMP routes based on weights added to ECMP routes. More traffic is directed to routes with higher weights. After selecting weight-based you must add weights to static routes.
Spillover (also called usage-based)
The FortiGate unit distributes sessions among ECMP routes based on how busy the FortiGate interfaces added to the routes are.
After selecting spill-over you add route Spillover Thresholds to interfaces added to ECMP routes. The FortiGate unit sends all ECMP-routed sessions to the lowest numbered interface until the bandwidth being processed by this interface reaches its spillover threshold. The FortiGate unit then spills additional sessions over to the next lowest numbered interface.
The Spillover Thresholds range is 0-2097000 KBps.
You can configure only one of these ECMP route failover and load balancing methods in a single VDOM. If your FortiGate unit is configured for multiple VDOM operation, each VDOM can have its own ECMP route failover and load balancing configuration.
To configure the ECMP load balancing method from the web‑based manager
1. Go to Router > Static > Settings.
2. Set ECMP Load Balance Method to Source IP based, Weighted Load Balance, or Spillover.
To configure the ECMP load balancing method from the CLI
For example, to set the load balancing method to usage-based, enter the following:
config system settings
set v4-ecmp-mode usage‑based
end