BGP Path Attributes Reference
Cheat sheet · https://pcornel.dk/topic.php?topic=214
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-mapclear ip bgp <neighbor> soft inshow 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
| Boundary | Known-good for BGP Path Attributes Reference | Suspicious signature | Next proof |
|---|---|---|---|
| Input/session | Correct peer, source, AF and route context | Session/source/input state disagrees | Exact peer/source/prefix detail |
| Policy/protocol | path-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 design | policy 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 source | Compare policy/attributes/propagation |
| Route/forwarding | Expected result reaches RIB/FIB | Control-plane state exists but installed path disagrees | RIB/FIB/CEF + next-hop proof |
| Closure | Original workload passes for explained reason | Symptom moved, was bypassed or state was forced | Regression/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