BGP Best-Path Reference
Cheat sheet · https://pcornel.dk/topic.php?topic=215
Answer
BGP selects one best path (plus extra multipath routes if configured) from the valid candidates for a prefix by comparing attributes in a fixed order, then offers it to the routing table, where administrative distance decides between route sources.
Remember
Best in BGP does not automatically mean installed in the RIB; administrative distance and next-hop resolution still matter.
First checks
show bgp <prefix> → candidate/best path reason. show ip route <prefix> → RIB. show ip cef <prefix> → forwarding.
Commands
show ip cef [prefix]- Inspect FIB/CEF forwarding entries.
show ip routeshow ip bgp neighbors 192.0.2.2 routesshow ip route 203.0.113.0 255.255.255.0show ip bgp rib-failureshow ip bgp neighbors 192.0.2.2clear ip bgp 192.0.2.2 soft inshow ip bgp neighbors <peer-address> advertised-routes
Verify in this order
prefix received → path valid (NEXT_HOP, inbound policy) → best path → RIB (no rib-failure) → CEF/adjacency → traffic and return path
Where it usually breaks
underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=215