Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Path Attributes Reference

Direct 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.

When to use this

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.

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · Cisco IOS XE · Cisco IOS / IOS XE
Key commandshow bgp ipv4 unicast <prefix>
Scope / prerequisiteUse it to see which attributes a route carries, which of them survive an AS boundary, and which one to set for a given …
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Verification

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.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 (or out).
  • 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 references

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.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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.

Key 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.

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

AttributeSet byInfluencesDirection
WEIGHT (Cisco)The local routerThis router's choice onlyOutbound from this router
LOCAL_PREFInbound policyThe whole AS's exit choiceOutbound from the AS
AS_PATH (prepending)Outbound policyOther ASes' choiceInbound to the AS
MEDOutbound policyA neighbouring AS's choice of entry pointInbound to the AS
ORIGINThe originatorTie-breaking (rarely changed)—
COMMUNITIESAnyonePolicy elsewhere (tags)Both
NEXT_HOPeBGP or next-hop-selfReachability—

Which tool for which goal

GoalTool
Prefer ISP A for outbound trafficHigher LOCAL_PREF on routes from ISP A
Make inbound traffic prefer ISP APrepend on announcements to ISP B; communities if the providers support them
Choose an entry point within one neighbour ASMED towards that AS
Override everything on one routerWEIGHT
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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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:

AttributeReachTypical use
WeightThis router only (Cisco-specific, not sent)Prefer one exit on a single router
LOCAL_PREFThe whole AS, over iBGPChoose the exit for outbound traffic
AS_PATHEverywhereLoop prevention; prepend to make a path less attractive for inbound traffic
MEDThe neighbouring AS onlySuggest an entry point to a neighbour with several links
NEXT_HOPChanged at each eBGP hopMust be reachable for the route to be usable
COMMUNITYAs far as each router sends it onTag 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
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS / IOS XE RFC 4271Set several attributes on routes received from one neighbour

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 in

Expected output

Cisco IOS / IOS XE RFC 4271show ip bgp 203.0.113.0 255.255.255.0

Expected 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.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 4271

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
bgp attributeslocal preferenceas pathmedweightcommunitynext hop
Embedded reference data

Quick lookup tables

BGP Path Attributes Reference operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

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
Embedded quick reference

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.

Confirmation

Confirm action

Continue?