Chapter 2 Advanced Routing for FortiOS 5.0 : Advanced Static Routing : Advanced static example: ECMP failover and load balancing : Configuring weighted static route load balancing
  
Configuring weighted static route load balancing
Configure weighted load balancing to control how the FortiGate unit distributes sessions among ECMP routes by adding weights for each route. Add higher weights to routes that you want to load balance more sessions to.
With the ECMP load balancing method set to weighted, the FortiGate unit distributes sessions with different destination IPs by generating a random value to determine the route to select. The probability of selecting one route over another is based on the weight value of each route. Routes with higher weights are more likely to be selected.
Large numbers of sessions are evenly distributed among ECMP routes according to the route weight values. If all weights are the same, sessions are distributed evenly. The distribution of a small number of sessions; however, may not be even. For example, its possible that if there are two ECMP routes with the same weight; two sessions to different IP addresses could use the same route. On the other hand, 10,000 sessions with different destination IPs should be load balanced evenly between two routes with equal rates. The distribution could be 5000:5000 or 50001:4999. Also, 10 000 sessions with different destination IP addresses should be load balanced as 3333:6667 if the weights for the two routes are 100 and 200.
Weights only affect how routes are selected for sessions to new destination IP addresses. New sessions to IP addresses already in the routing cache are routed using the route for the session already in the cache. So in practice sessions will not always be distributed according to the routing weight distribution.
To add weights to static routes from the web‑based manager
1. Go to Router > Static > Settings.
2. Set ECMP Load Balance Method to Weighted Load Balance.
3. Go to Router > Static > Static Routes.
4. If needed, add new static routes, for example:
 
Destination IP/Mask
192.168.20.0/24
Device
port1
Gateway
172.20.110.1
Distance
10
 
Destination IP/Mask
192.168.20.0/24
Device
port2
Gateway
172.20.120.2
Distance
10
5. Go to Router > Static > Settings.
6. Select a number next to an interface name, and choose Edit to change it.
For example, set the weight of port1 to 100 and the weight of port2 to 200.