Pcornel
Networking · Routing › BGP › BGP Path Selection

BGP Best-Path Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=215

Back to the Topic

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 route
show ip bgp neighbors 192.0.2.2 routes
show ip route 203.0.113.0 255.255.255.0
show ip bgp rib-failure
show ip bgp neighbors 192.0.2.2
clear ip bgp 192.0.2.2 soft in
show 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

Confirmation

Confirm action

Continue?