Some years ago I was consulting a project and there the team faced an issue with load-sharing the outbound traffic towards different eBGP neighbors from different ASs. They reached out to me and it took me some times to find the solution. Suddenly I was skimming through my documents and saw that, so I’m gonna share it here too.
When implementing BGP in a Cisco environment, you may want to load-share the outgoing traffic between multiple next-hops which you have. The first command which probably you are thinking of is
maximum-path 4 to use 4 different paths.
Yeah, that’s somehow true, but it requires the following attributes to match:
- local preference
- AS path
- origin code
- IGP metric.
And for sure, the next-hop address for each path must also be different in order for that path to be considered. (imagine when multi-homing to the same router)
The point here is that, the router should receive the routes from the same AS.
So, what if we wanna load-share between different eBGP neighbors from different ASs?
Now we are delighted with an undocumented (unsupported) Cisco command:
csr1000v(config-router)#bgp bestpath as-path multipath-relax