Tip: Checking the BGP best path reason in IOS-XRJul 03, 21
Short tip, in case you want to quickly know the reason why an IP prefix has been selected in BGP, you can use the
best-compare keyword when querying the prefix.
XR1#show bgp ipv4 unicast 220.127.116.11/24 bestpath-compare Paths: (2 available, best #2) Advertised to peers (in unique update groups): 10.1.2.2 Path #1: Received by speaker 0 64513 15169 Origin incomplete, metric 0, localpref 100, valid, external, group-best Received Path ID 0, Local Path ID 0, version 0 Origin-AS validity: not-found best of AS 64513 Longer AS path than best path (path #2) << !Reason for not being best Path #2: Received by speaker 0 64666 10.1.3.3 from 10.1.3.3 (18.104.22.168) Origin-AS validity: not-found best of AS 64666, Overall best << !
As seen, the reason why the best path is path #2 is due to the fact that path #1 has a longer AS path. This is a quick and convenient way to check reason why the prefix has been chosen, which could help in production networks and/or CCIE Service Provider lab.