Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Core Attribute Field Reference

Direct answer

Six attributes do most of the work in BGP: ORIGIN, AS_PATH, NEXT_HOP, MED, LOCAL_PREF and COMMUNITIES. They appear as the Next Hop, Metric, LocPrf and Path columns of show ip bgp; communities only in the per-prefix view.

When to use this

Use it to read BGP output correctly and to see which attribute decided between two paths.

First 30 seconds

1. show ip bgp <prefix> — list the paths; which is best?

2. Next hop reachable on each? If not, that path is out.

3. Compare weight, then local preference, then AS path length, origin, MED.

4. The first difference is the reason.

5. A policy should have set something → is the value there?

Operational verification

path received → next hop reachable (valid) → weight → LOCAL_PREF → locally originated → AS_PATH length → ORIGIN → MED (same neighbouring AS) → eBGP over iBGP → IGP cost to next hop

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
Key commandshow ip bgp
Scope / prerequisiteUse it to read BGP output correctly and to see which attribute decided between two paths.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

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

2 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 Verify boundary
show ip bgp
show ip bgp 203.0.113.0/24
show ip bgp neighbors 192.0.2.2 routes

The table view gives one line per path with the columns above. The prefix detail spells every attribute out for each path — AS path, next hop and whether it is reachable, origin, metric, localpref, weight, communities — and marks one path as best; newer releases also print the reason other paths lost. The neighbour view limits the table to one neighbour's routes.

Known-good: the best path is the intended one, and each attribute a policy is supposed to set shows the intended value on the intended paths.

Step 2 Failure isolation workflow Narrow the fault
  • A blank LocPrf is read as zero. It means the default of 100 applies.
  • A blank Metric is read as "no preference". A missing MED counts as 0 and wins over any explicit value.
  • MED is set but ignored. The competing paths come from different neighbouring ASes, or an earlier criterion — weight, LOCAL_PREF, AS path length — already decided.
  • A redistributed route loses to a network route with identical attributes. Origin ? is less preferred than i.
  • A path with better attributes is not chosen. Its next hop is unreachable, so it lacks the valid flag.
  • Weight explains a choice that the attributes do not. A locally originated route has weight 32768 and beats any learned path.
  • Communities are looked for in the table view. They appear only in the per-prefix detail.
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

A blank LocPrf means the default 100, not zero. A blank Metric means no MED, which counts as 0 — the best value. The last character of Path is the origin (i beats ?). Weight is local to the router and is compared first; 32768 marks a route this router originated.

Key checks
  • show ip bgp — one line per path: status flags, next hop, metric, local preference, weight, path.
  • show ip bgp <prefix> — every attribute spelled out per path, the best path, communities.
  • show ip bgp neighbors <ip> routes — one neighbour's paths.
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

A handful of path attributes do most of the work in BGP: ORIGIN, AS_PATH, NEXT_HOP, MED, LOCAL_PREF and COMMUNITIES. This topic describes what each one contains and how it appears in the columns and lines of show ip bgp.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

Reading BGP output means reading these attributes. The summary table packs them into a few terse columns, some of which are blank when a default applies, and misreading a blank or a zero leads to wrong conclusions about why a path was chosen.

ReferenceHow it works1 section · depth on demand

How it works

AttributeType codeValueShown in show ip bgp as
ORIGIN1How the route entered BGP: 0 IGP, 1 EGP, 2 incompleteThe last character of the Path column: i, e or ?
AS_PATH2The list of AS numbers the route has passedThe Path column
NEXT_HOP3The address to send traffic toThe Next Hop column
MED4A 32-bit number suggested by the neighbouring AS; lower is preferredThe Metric column
LOCAL_PREF5A 32-bit number valid inside the AS; higher is preferredThe LocPrf column
COMMUNITIES8A list of 32-bit tagsOnly in the detailed view, show ip bgp <prefix>

A typical line:

   Network          Next Hop        Metric LocPrf Weight Path
*> 203.0.113.0/24   192.0.2.2            0    150      0 65010 65020 i

Reading the columns.

  • Path 65010 65020 i — received from AS 65010, originated in AS 65020, origin IGP. An empty path with only i or ? is a route originated in the local AS.
  • Origin i means the route was put into BGP with a network statement; ? means it was redistributed. i is preferred over ?.
  • Metric is the MED. A blank means the neighbour sent none, which Cisco treats as 0 — the best possible value — unless bgp bestpath med missing-as-worst is configured.
  • LocPrf is blank for routes learned from eBGP neighbours where no policy set it; they are treated as having the default, 100. Routes from iBGP neighbours show the value that was sent.
  • Weight is not an attribute at all but a local value on Cisco routers: 32768 for routes the router originated itself, 0 for others unless set. It is compared before anything else.
  • Next Hop 0.0.0.0 means the route was originated on this router.
  • The status flags at the left: * valid, > best, i learned from iBGP, r not installed in the routing table, s suppressed.

MED is compared only between paths received from the same neighbouring AS, unless bgp always-compare-med is set.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

The core path attributes

A small set of attributes drives most BGP decisions. RFC 4271 defines them:

  • ORIGIN (type 1): 0 IGP, 1 EGP, 2 INCOMPLETE.
  • AS_PATH (type 2): AS_SEQUENCE and AS_SET segments.
  • NEXT_HOP (type 3): the address to forward to.
  • MULTI_EXIT_DISC (type 4): optional non-transitive, compared between paths from the same neighbouring AS.
  • LOCAL_PREF (type 5): sent to iBGP peers only.
  • ATOMIC_AGGREGATE (type 6) and AGGREGATOR (type 7): describe aggregation.

COMMUNITIES (type 8) comes from RFC 1997.

Attributes and their role in best-path selection

AttributeCategoryScopePreferred value
LOCAL_PREFWell-known discretionaryWithin the AS (iBGP)Higher
AS_PATHWell-known mandatoryGlobalShorter
ORIGINWell-known mandatoryGlobalIGP < EGP < INCOMPLETE
MEDOptional non-transitiveBetween neighbouring ASesLower
NEXT_HOPWell-known mandatoryNext-hop reachability requiredLower IGP metric to it
COMMUNITIESOptional transitiveGlobal, policy tagsNot compared

NEXT_HOP behaviour

SessionNEXT_HOP sent
eBGPUsually the sending router's own address
iBGPUnchanged by default: the eBGP neighbour's address
iBGP with next-hop-selfThe sending router's address

If an iBGP peer can't reach the NEXT_HOP through its IGP, the route is unusable. That is a common cause of "BGP route not installed".

R1# show bgp ipv4 unicast 192.0.2.0/24
BGP routing table entry for 192.0.2.0/24, version 8211
Paths: (2 available, best #1, table default)
  64500 64496
    203.0.113.2 from 203.0.113.2 (203.0.113.2)
      Origin IGP, metric 20, localpref 200, valid, external, best
      Community: 65010:100
  64501 64502 64496
    10.255.0.2 (metric 11) from 10.255.0.2 (10.255.0.2)
      Origin IGP, metric 0, localpref 100, valid, internal
R1(config-router-af)# neighbor 10.255.0.2 next-hop-self
R1(config-router-af)# neighbor 10.255.0.2 send-community both

In this example path 1 wins on LOCAL_PREF (200 against 100) before AS_PATH length is even compared.

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.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
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 Core Attribute Field 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 attribute fieldsas path fieldlocal pref fieldmed fieldcommunity field
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

BGP Core Attribute Evidence

Fast path-attribute comparison.

Compare next-hop validity, Weight (Cisco), Local Preference, AS_PATH, Origin, MED and communities. Separate received values from post-policy local values.

Confirmation

Confirm action

Continue?