Non-Optimal Multi-Homed Routing
Last updated
Last updated
Load vpnv4.non-optimal.routing.init.cfg
R1 and XR2 are located at the same customer site. The intention is for R1 to be used as the prefered exit point for routes to remote MPLS sites, so R1 sets LP to 110 on routes received from R2.
Currently there is asymmetric routing between R1 and XR2. Fix this without using BGP policy, and without removing the as-override command on the PEs.
R1 is setting LP=110 on all routes received from R2. This includes prefixes that XR2 is advertising. Therefore, R1 is preferring the eBGP route over the iBGP route. (The iBGP route would normally win due to shorter AS path).
If you are not seeing XR2’s routes via eBGP on R1, this is due to the order that the BGP peering sessions came up. R2 is hiding XR2’s prefixes from R1 because it has a bestpath for XR2’s prefixes via R1 itself. You can do a hard reset on R1 so that it will initially learn the prefixes from both peers, and then will choose R2 due to the higher LP.
One way to prevent this is to simply turn off the as-override command on the PEs. The routers would reject the eBGP routes for loop prevention. However, if there are other sites in this VPN which re-use this same ASN, this might not be a good option.
A better solution is to use the SoO (Site of Origin) feature. This essentially just implements an extcommunity filter on the PEs. Routes received from the CE are tagged with the configured SoO value, and any routes to be advertised to the CEs containing this extcomm value are filtered. This is generally much easier than manually configuring a route-map which matches/sets the extcommunity value. All you need to do is associate a SoO value with the BGP neighbor.
On the PEs, we can see that the received VPNv4 updates now have this SoO extcommunity value:
R2 no longer advertises XR2’s prefixes to R1 because the SoO on the route matches R1’s configured SoO. So R1 only has the iBGP path left in its BGP table.
Note that this solution prevents the MPLS network from being used as a backup path. If the R1-XR2 iBGP session goes down, the routers will no longer have any reachability with each other. But in the real world, these two routers may be directly (physically) connected, so it may not be realistic to say that these routers would need to use the MPLS WAN as backup.