Lab1 ECMP
Load lab1.init.cfg
#R1, R6
configure replace unix:lab1.init.cfg
#R2-R5
configure
load bootflash:lab1.init.cfg
commit replace
y
The idea behind these labs is that R6 is advertising 192.0.2.6/32 and 2001:db8::6/128. It is multi-homed to R4 and R5. We will use various techniques to achieve load balancing and failover.
This series of labs is identical to the previous series, except XRv is used in the core instead of IOS-XE.
This first lab requires you to configure ECMP. Currently R2 and R3 are using R4 for egress due to its lower RID. R6 is using R4 for this reason as well. Configure the fewest number of routers so that traffic from R1 to R6 is load balanced through R4 and R5, and return traffic from R6 is likewise load balanced.
As an additional challenge, on the provider XR router(s), ensure that only neighbors that are explicitly activated for multipathing can be considering for the ECMP routes.
Answer
https://www.youtube.com/watch?v=AJXdxembu_8&list=PL3Y9eZjZCcsejbVWD3wJIePqe3NiImqxB&index=2
#R3
router bgp 65000
add ipv4 unicast
maximum-paths ibgp 2 selective
add ipv6 unicast
maximum-paths ibgp 2 selective
!
neighbor fc00::4
address-family ipv6 unicast
multipath
!
neighbor fc00::5
address-family ipv6 unicast
multipath
!
neighbor 10.0.0.4
address-family ipv4 unicast
multipath
!
neighbor 10.0.0.5
address-family ipv4 unicast
multipath
#R6
router bgp 65006
add ipv4
maximum-paths 2
add ipv6
maximum-paths 2
Explanation
The maximum-paths feature allows multiple BGP paths to be used for load balancing if all criteria up to the IGP metric of the nexthop match. Additionally, the AS_PATH content must be the same.
Enabling ECMP for IOS-XR is the same as on IOS-XE. Enabling ECMP for only iBGP routes is done using:
router bgp 65000
maximum-paths ibgp num
Enabling ECMP for only eBGP routes is done using:
router bgp 65000
maximum-paths num
Enabling ECMP for both iBGP and eBGP routes can be done using the following command, but can introduce loops:
router bgp 65000
maximum-paths eibgp 2
%BGP: This may cause traffic loop if not used properly (command accepted)
On IOS-XR, the router does not appear to give you this warning.
On IOS-XR, we also have the selective multipath capability. When using this keyword, the router will only consider paths for ECMP from neighbors that have the multipath keyword configured.
#R3
router bgp 65000
add ipv4 unicast
maximum-paths ibgp 2 selective
!
neighbor 10.0.0.4
address-family ipv4 unicast
multipath
!
neighbor 10.0.0.5
address-family ipv4 unicast
multipath
For example, if we remove the multipath keyword from the neighbor definition for R5, it is no longer used for ECMP.

#R3
router bgp 65000
neighbor 10.0.0.5
address-family ipv4 unicast
no multipath

Verification
On R3 we must look at the route details to see that we are using multipath. The basic BGP table does not have an indicator for multipath like we have with IOS-XE.



We can verify in the FIB that traffic is being load shared:

On R6, we can similarly verify outgoing traffic is load shared among R4 and R5.

The reason that we do not need to enable iBGP multipath on R2, is that it will always use R3 to get to R4 and R5, so enabling multipath does not technically achieve anything. It can be done, but the result is the same with or without it.
Last updated