BGP Multipath Load Sharing
BGP Multipath Load Sharing Overview
BGP can install multiple equal-cost eBGP or iBGP paths into the routing table to reach the same destination prefix. Traffic to the destination prefix is then shared across all the installed paths.
The BGP best-path algorithm considers the paths as equal-cost paths if the following attributes are identical:
•Multi-exit discriminator (MED)
BGP selects only one of these multiple paths as the best path and advertises the path to the BGP peers.
Configuration:
To configure the maximum number of paths, use the following command in router address-family configuration mode:
switch(config-router-af)# maximum-paths 2
Code language: PHP (php)
Dual Homed Scenario (Different ASN)
The above command isn’t enough in case of dual-homed scenario to two different ASN (two different service providers):
By default, BGP does not allow you to load balance between multiple paths received from different AS numbers.
meaning that by default, The AS-PATH length has to be the same for considered paths and the ASN needs to be the same as well.
There is a command to relax this requirement for the AS-PATH:
bgp bestpath as-path multipath-relax
Code language: JavaScript (javascript)
This command configure BGP to treat two BGP routes as equal cost and allow load sharing even if their AS-paths differ, as long as their AS-path lengths and other relevant attributes are the same.
In both cases: