BGP Load Sharing (Multipath)
By default, a router will never use multiple BGP routes to the same destination. A router always picks a single best BGP path. If many path attributes are the same between multiple paths, “random” criteria such as the lowest RID and then lowest neighbor IP address are used to pick a single path.
When enabling multipath, you have three options. You can enable multiple for iBGP routes, eBGP routes, or both iBGP/eBGP routes. If you enable mulitple for both iBGP/eBGP routes, this is called “eiBGP.” It considers both iBGP and eBGP paths to be equal. (Otherwise eBGP paths would always beat iBGP paths). However, you can also separately enable iBGP multipath and eBGP multipath, which will only consider like-paths for multipathing (iBGP and eBGP paths are not considered equal, only multiple iBGP paths can be multipath or multiple eBGP paths can be multipath).
When using multipath, it is important to understand that a single path is still selected as the “best path.” However, multiple paths can be installed into the RIB and used for load sharing. But the single “best path” is what will be advertised to other neighbors. The process of advertising only the best path to a neighbor has not changed. In order to change this, you would use the add path feature, which we are not looking at in this article.
In order for paths to be considered for multipath, the following must match:
Weight
Local pref
AS-Path length
AS-Path content
Paths must have the exact same AS path
Origin
MED
IGP metric to the next-hop
This means that the next-hop for each path can be different as long as the metrics to the next-hops are the same
To enable multipath you use the following commands:
Examples
eBGP multipath
On R1, I have enabled eBGP multipath, but the paths have a differing neighboring AS
The path from 10.1.3.3 is not considered for multipathing because it is learned from a different AS (65003) compared to the current best path
If we change the topology and learn the prefix from two different neighbors from the same neighboring AS, the route is still not installed, because the AS path content is not exactly the same. Interestingly, Cisco guides will say that only the neighboring AS needs to be the same, but this does not appear to be the case. It seems this may have been the case on older IOS versions.
We can tell R1 to relax the AS-Path content check, and only ensure that the AS-Path length is identical:
The m means the path has been selected for multipath. The route from 10.1.5.5 is still the bestpath, and is the path that would be advertised to other BGP neighbors.
iBGP multipath
I’ll change the topology once more so we can verify iBGP multipath. R1’s two neighbors are now iBGP neighbors.
The paths have the same neighboring AS but not the same exact AS Path. We can relax the AS-Path content check again to use both paths for multipath.
If I change peering to use loopbacks, and change the IGP metric for R6 to be higher, the path from R6 can no longer be used for multipath.
If we want to disable the IGP metric check, we can use the following command:
Be aware that igp-metric ignore is slightly different than as-path multipath-relax. Disabling the IGP metric check affects all best path decisions, not just multipath consideration. The content of the AS Path is never a consideration for bestpath (only the AS Path length is), so the as-path multipath-relax command only affects multipath consideration.
On IOS-XR you can disable the IGP metric check for only multipath consideration using the following command:
eiBGP multipath
Once you understand iBGP and eBGP multipath, eiBGP multipath is fairly straight-forward. The only difference is that with eiBGP multipath, both iBGP and eBGP paths can be used for ECMP to a destination.
R1 now has one eBGP peer and one iBGP peer. To enable load sharing between both paths, we use the maximum-paths eibgp command.
The router warns us that when using eibgp multipath, loops are possible. If two iBGP peers use eiBGP and have both an eBGP route and iBGP route pointing to each other, the peers could loop traffic between each other (if both routers select the iBGP path at the right time).
R1 has two ECMP routes via R3 and R2
R2 has two ECMP routes via R4 and R1
R1 and R2 could loop traffic between each other
For this reason you must be very careful when using eiBGP multipathing.
Last updated