Pcornel
Networking · Routing › BGP › BGP Path Selection

BGP Path Attributes Reference

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

Back to the Topic

Answer

BGP path attributes are the properties attached to each route — Weight, LOCAL_PREF, AS_PATH, ORIGIN, MED, NEXT_HOP and others — that BGP compares in a fixed order to choose the best path.

Remember

Well-known mandatory attributes are in every update: ORIGIN, AS_PATH, NEXT_HOP. LOCAL_PREF is well-known but stays inside the AS. MED is optional non-transitive: it goes to the neighbouring AS and no further. Communities are optional transitive and travel on. Weight is not an attribute at all — it is a local Cisco value that never leaves the router.

First checks

show ip bgp <prefix> → all attributes per path. show ip bgp neighbors <ip> received-routes vs routes → before and after inbound policy (needs soft-reconfiguration inbound). show route-map → which clause sets what.

Commands

show bgp ipv4 unicast <prefix>
BGP path attributes and best-path information for a prefix.
show route-map
clear ip bgp <neighbor> soft in
show ip bgp <prefix>

Verify in this order

attributes arrive in the UPDATE → inbound route-map may set or change them → stored with the path → compared in best-path order → outbound route-map may change them → advertised (LOCAL_PREF removed toward eBGP, NEXT_HOP rewritten, own AS prepended)

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

BGP Path Attributes Reference operational reference

BoundaryKnown-good for BGP Path Attributes ReferenceSuspicious signatureNext proof
Input/sessionCorrect peer, source, AF and route contextSession/source/input state disagreesExact peer/source/prefix detail
Policy/protocolpath-attribute interpretation across Weight, LOCAL_PREF, locally originated state, AS_PATH, Origin, MED, eBGP/iBGP context and next-hop reachability without confusing one attribute with the complete best-path decision matches intended designpolicy sets an attribute in the wrong direction, the expected attribute is absent because a route-map sequence did not match, multiple candidate paths make a visually attractive attribute non-decisive, next-hop recursion invalidates a candidate, or BGP selects a path that still loses RIB installation to another route sourceCompare policy/attributes/propagation
Route/forwardingExpected result reaches RIB/FIBControl-plane state exists but installed path disagreesRIB/FIB/CEF + next-hop proof
ClosureOriginal workload passes for explained reasonSymptom moved, was bypassed or state was forcedRegression/failover test

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=214

Confirmation

Confirm action

Continue?