BGP - ECMP for specific prefixes

When configuring BGP is is possible to enable equal-cost multi-path routing allowing a network topology to leverage multiple paths to a destination. BGP in particular can be configured to behave in this way by enabling the BGP equal cost multipath feature using a particular configuration syntax.

Whenever this feature is enabled, it applies to all prefixes that have the same AS path, next-hop, origin code, MED, and IGP metric, and have a different next hop address. This is a prerequisite for BGP to achieve ECMP routing.

However, there is no direct way to cause ECMP to apply only certain prefixes. This can be done indirectly by modifying the attributes of specific prefixes so that you can make them eligible or ineligible for ECMP, based on the above prerequisites mentioned. You can do this by applying route maps to the prefixes you choose. This is kind of a round about way of doing it, and it can quickly get complex. But it is doable.

Links:

https://forum.networklessons.com/t/bgp-multipath-load-sharing-ibgp-and-ebgp/3275/46?u=lagapides

https://forum.networklessons.com/t/bgp-multipath-load-sharing-ibgp-and-ebgp/3275