Use it to see which attributes a route carries, which of them survive an AS boundary, and which one to set for a given purpose.
BGP Path Attributes Reference
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.
1. show ip bgp <prefix> — read AS_PATH, NEXT_HOP, origin, MED, LOCAL_PREF, weight, communities.
2. Well-known mandatory: ORIGIN, AS_PATH, NEXT_HOP.
3. Check what a route-map changed with show ip bgp neighbors <ip> routes vs received-routes.
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)
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show bgp ipv4 unicast <prefix>Show Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
How to read the output
show bgp ipv4 unicast <prefix>Look first: paths, next hop, AS_PATH, local-pref/MED/weight, best marker
Healthy: Expected path is accepted and selected according to policy.
Warning: Unexpected best path, inaccessible next hop, missing path or policy attributes.
Does not prove: Best BGP path does not prove installation/forwarding if another boundary intervenes.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification and known-good state Verify boundary
show ip bgp 203.0.113.0/24
show ip bgp neighbors 192.0.2.2 routes
show route-map
The prefix detail prints every path with its attributes: AS path, next hop, origin, metric (MED), localpref, weight and communities, and marks one path best. The routes view shows what was accepted from one neighbour after inbound policy. show route-map shows the policy and how many routes matched each clause.
Known-good: the attribute the policy sets is visible with the intended value on the intended paths, and the intended path is best.
Step 2 Failure signatures and troubleshooting branches Narrow the fault
- The policy is configured but the attribute is unchanged. The routes were received before the policy; refresh with
clear ip bgp <neighbor> soft in(orout). - Weight is set but other routers do not follow. Weight never leaves the router.
- LOCAL_PREF is set towards an eBGP neighbour. It is not sent over eBGP.
- MED is set but the neighbour ignores it. MED is compared only between paths from the same neighbouring AS, and after LOCAL_PREF and AS_PATH length.
- Prepending does not move inbound traffic. The other AS prefers the path with its own LOCAL_PREF, which is compared first.
- A path with good attributes is not used. Its next hop is unreachable, so it is not a candidate.
Step 3 When the problem is really fixed Narrow the fault
show ip bgp <prefix>shows the attribute with the intended value on the intended path.- That path is marked best — on every router where it should be.
- For outbound attributes, the neighbouring AS sees the change.
- Traffic follows the intended path.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
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.
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.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
Path attributes are the properties BGP attaches to every route: where it came from, which autonomous systems it passed, where to send traffic, and how much the route is preferred. BGP chooses between routes by comparing these attributes, and policy works by changing them.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
To influence BGP you need to know two things about each attribute: how far it travels, and which direction of traffic it affects. Setting an attribute that never leaves the router, or that the neighbour ignores, is the usual reason a policy has no effect.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
BGP path attributes and how they're used
Path attributes are the information BGP attaches to every route. RFC 4271 defines the categories:
- Well-known mandatory: ORIGIN, AS_PATH and NEXT_HOP.
- Well-known discretionary: LOCAL_PREF (used inside an AS) and ATOMIC_AGGREGATE.
- Optional non-transitive: MULTI_EXIT_DISC.
- Optional transitive: AGGREGATOR.
Its decision process breaks ties between equally preferred routes in this order:
1. Shortest AS_PATH.
2. Lowest ORIGIN.
3. Lowest MED, compared only between routes from the same neighbouring AS.
4. eBGP over iBGP.
5. Lowest IGP cost to the NEXT_HOP.
6. Lowest BGP identifier.
7. Lowest peer address.
Attributes and the direction they influence
| Attribute | Set by | Influences | Direction |
|---|---|---|---|
| WEIGHT (Cisco) | The local router | This router's choice only | Outbound from this router |
| LOCAL_PREF | Inbound policy | The whole AS's exit choice | Outbound from the AS |
| AS_PATH (prepending) | Outbound policy | Other ASes' choice | Inbound to the AS |
| MED | Outbound policy | A neighbouring AS's choice of entry point | Inbound to the AS |
| ORIGIN | The originator | Tie-breaking (rarely changed) | — |
| COMMUNITIES | Anyone | Policy elsewhere (tags) | Both |
| NEXT_HOP | eBGP or next-hop-self | Reachability | — |
Which tool for which goal
| Goal | Tool |
|---|---|
| Prefer ISP A for outbound traffic | Higher LOCAL_PREF on routes from ISP A |
| Make inbound traffic prefer ISP A | Prepend on announcements to ISP B; communities if the providers support them |
| Choose an entry point within one neighbour AS | MED towards that AS |
| Override everything on one router | WEIGHT |
R1(config)# route-map FROM-ISP-A permit 10
R1(config-route-map)# set local-preference 200
R1(config)# route-map TO-ISP-B permit 10
R1(config-route-map)# set as-path prepend 65010 65010 65010
R1(config)# router bgp 65010
R1(config-router-af)# neighbor 203.0.113.1 route-map FROM-ISP-A in
R1(config-router-af)# neighbor 198.51.100.9 route-map TO-ISP-B out
R1# show bgp ipv4 unicast 192.0.2.0/24 | include localpref|from|best|64500|64501
ispb# show bgp ipv4 unicast 198.51.100.128/25 | include 65010
65010 65010 65010 65010
Verify from outside
Inbound traffic engineering only works if the other side sees and honours the change. Check from a looking glass or the provider's router that the prepended path actually appears, as in the last line.
Documented example, not captured output.
Mechanics and state ownership
Attributes fall into four classes. Well-known mandatory attributes are in every update: ORIGIN, AS_PATH and NEXT_HOP. Well-known discretionary ones are understood by all routers but not always present: LOCAL_PREF and ATOMIC_AGGREGATE. Optional transitive attributes, such as COMMUNITY and AGGREGATOR, are passed on even by routers that do not understand them. Optional non-transitive ones, such as MED, ORIGINATOR_ID and CLUSTER_LIST, are not.
More useful in practice is how far each one reaches:
| Attribute | Reach | Typical use |
|---|---|---|
| Weight | This router only (Cisco-specific, not sent) | Prefer one exit on a single router |
| LOCAL_PREF | The whole AS, over iBGP | Choose the exit for outbound traffic |
| AS_PATH | Everywhere | Loop prevention; prepend to make a path less attractive for inbound traffic |
| MED | The neighbouring AS only | Suggest an entry point to a neighbour with several links |
| NEXT_HOP | Changed at each eBGP hop | Must be reachable for the route to be usable |
| COMMUNITY | As far as each router sends it on | Tag routes for policy |
Weight and LOCAL_PREF are set on routes as they come in and steer traffic leaving the AS. AS_PATH prepending and MED are set on routes going out and try to steer traffic coming in — which the other AS is free to override.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Lab addressing; local AS 65000; loopbacks carried in the IGP.
route-map FROM-ISP-A permit 10
set local-preference 200
set community 65000:100 additive
!
router bgp 65000
address-family ipv4 unicast
neighbor 192.0.2.2 route-map FROM-ISP-A in
!
! then: clear ip bgp 192.0.2.2 soft inExpected output
show ip bgp 203.0.113.0 255.255.255.0Expected state: All attributes of one path in the detailed view.
BGP routing table entry for 203.0.113.0/24
Paths: (1 available, best #1, table default)
65010 65030
192.0.2.2 from 192.0.2.2 (2.2.2.2)
Origin IGP, metric 50, localpref 200, valid, external, best
Community: 65000:100
! Illustrative output, not captured Evidence.AS_PATH `65010 65030`, NEXT_HOP 192.0.2.2, ORIGIN IGP, MED 50 (`metric`), LOCAL_PREF 200 and one community. Weight is not printed because it is 0.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → BGP Path Attributes Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
BGP Path Attributes Reference operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| 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 |
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
BGP Attributes Fast Reference
Common path-policy fields.
Weight → Cisco-local, higher preferred
Local Preference → AS-wide outbound preference, higher preferred
AS_PATH → loop prevention/path signal; shorter often preferred
Origin → route origin code
MED → inbound hint; lower often preferred when compared
NEXT_HOP → must be reachable
Community → policy tag
Always read platform-specific best-path details.