Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Path Selection

Direct answer

BGP path selection is the ordered comparison BGP uses to pick one best path per prefix: Weight, LOCAL_PREF, local origination, AS_PATH length, ORIGIN, MED, eBGP over iBGP and IGP metric to the next hop, then tie-breakers. The first difference decides.

When to use this

Use it to explain why BGP chose a path, and to pick the attribute to change for a goal: LOCAL_PREF for the exit used by the whole AS, Weight for one router only, AS_PATH prepending or MED to influence how a neighbouring AS sends traffic in. The child Topics cover the full order (Best Path) and each attribute.

First 30 seconds

1. show ip bgp <prefix> — all candidate paths; > marks best, the reason is in the attributes.

2. Walk the order: weight → LOCAL_PREF → locally originated → AS_PATH length → origin → MED → eBGP over iBGP → IGP cost to next hop → oldest/router ID.

3. Best path missing from the RIB? Look for r (RIB-failure) and check next-hop reachability.

Operational verification

prefix received from each neighbour → path valid (NEXT_HOP reachable, inbound policy permits) → first differing attribute in decision order → best marker → RIB (no rib-failure) → CEF → traffic and return path

Failure signatureBGP policy has no effect on path selection

A route-map setting local preference, MED or prepending is configured, but the best path does not change.

Possible stored cause: The policy is applied in the wrong direction or to the wrong neighbor, does not match the prefixes, or the session was not refreshed.
Evidence · next step

Check received/advertised routes for one prefix, then inspect best-path/RIB installation.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes

Do not equate Established with usable prefixes. A session can be healthy while policy filters the route, another path wins, the RIB rejects it, or the selected next hop is unresolved in the data plane.

Other frequent mistakes:

  • Assuming shortest AS_PATH wins. Weight and LOCAL_PREF are compared first, so prepending cannot beat a higher LOCAL_PREF.
  • Expecting Weight to influence other routers. It is local to the router where it is set and is never advertised.
  • Expecting LOCAL_PREF to influence a neighbouring AS. It is carried only over iBGP; to influence inbound traffic use AS_PATH prepending, MED or communities agreed with the provider.
  • Reading the trailing i in show ip bgp as "learned by iBGP". It is ORIGIN IGP.
  • Changing a route-map and expecting an immediate effect. Existing paths are re-evaluated only after a soft refresh or new update.
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 · IOS/IOS XE
Key commandshow bgp ipv4 unicast <prefix>
Scope / prerequisiteUse it to explain why BGP chose a path, and to pick the attribute to change for a goal: LOCAL_PREF for the exit used by…
Show · 6Reference · 8
What next?3 suggested next steps
Child topics (this level)9
Catalog command links14
Evidence4
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.

show bgp ipv4 unicast neighbors {{neighbor}} advertised-routes

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.

show bgp ipv4 unicast neighbors {{neighbor}} routes

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.

show bgp ipv4 unicast neighbors <neighbor>

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.

show bgp ipv4 unicast community <community>

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.

show bgp ipv4 unicast neighbors <peer> | section Capabil

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.

show bgp ipv4 unicast neighbors <peer>

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.

show bgp ipv4 unicast neighbors <peer> advertised-routes

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.

show bgp ipv4 unicast neighbors <peer> received-routes

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.

show bgp ipv4 unicast rib-failure

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.

show bgp ipv4 unicast neighbors <neighbor> received-routes

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.

show ip route [prefix]

Look first: route source/code, prefix, next hop, outgoing interface

Healthy: Expected prefix is installed with intended next hop/source.

Warning: Route absent, unexpected protocol/AD/metric, recursive next hop or wrong exit.

Does not prove: RIB presence does not prove FIB programming or packet delivery.

show ip cef [prefix]

Look first: prefix adjacency/next hop and egress interface

Healthy: CEF resolves the prefix to the intended adjacency.

Warning: Drop/punt/unresolved adjacency or unexpected egress.

Does not prove: A CEF entry does not prove downstream reachability or return path.

Operational workflow

Verification & Troubleshooting

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

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

A route-map setting local preference, MED or prepending is configured, but the best path does not change.

Step 1 Verification & evidence Verify boundary

show ip bgp <prefix>; show route-map; show ip prefix-list; compare attributes of all candidate paths.

Step 2 Operational verification Verify boundary

Fast verification

  • show ip bgp <prefix> — are all expected paths present, valid, and is the intended one marked best?
  • Walk the order on the differing values: Weight → LOCAL_PREF → local origin → AS_PATH → ORIGIN → MED → eBGP/iBGP → IGP metric to NEXT_HOP.
  • show ip route <prefix> and show ip bgp rib-failure — did the best path reach the routing table?
  • show ip cef <prefix> — does forwarding resolve to the expected interface?

Failure boundary

Missing path = advertisement or filter problem; invalid path = NEXT_HOP reachability; wrong best = policy/attribute; best but not installed = administrative distance; installed but wrong traffic = forwarding or return path.

Step 3 Commands & verification Verify boundary

These commands belong to this topic because they answer a direct configuration, state or verification question:

  • show ip bgp — Inspect BGP paths and attributes.
  • show ip bgp summary — Check BGP neighbor session state and prefix counts.
  • show ip cef — Inspect FIB/CEF forwarding entries.
  • show ip route — Display IPv4 routing table.

Do not treat one command as complete evidence. Combine the command output with the specific state or failure point described in the topic.

Step 4 Known-good, broken state and proof boundary Verify boundary

Known-good: all expected candidates are present and valid, the intended path is best because of the attribute your design sets, the routing table has the prefix as source B via that NEXT_HOP, and CEF forwards out the expected interface.

Proof boundary: show ip bgp <prefix> shows this router's view at this moment. It does not show what the neighbour AS prefers, how return traffic flows, or that a route reflector passed along every candidate.

Step 5 Observation-driven branch tree Narrow the fault

Start from show ip bgp <prefix> on the deciding router:

  • Prefix not in the BGP table → session, neighbour advertisement or inbound filter. Not a path-selection problem.
  • Path present but not valid → NEXT_HOP not reachable (show ip route <next-hop>); for iBGP, check next-hop-self on the edge router.
  • Unexpected path is best → walk the decision order and find the first differing attribute; trace which route-map or neighbour setting created it.
  • Expected path is best but not installed → show ip bgp rib-failure; another route source with lower administrative distance wins.
  • Installed but traffic goes elsewhere → show ip cef <prefix> and recursive next-hop resolution; then check the return path, which outbound preference does not control.
Step 6 Common failure modes Narrow the fault

Policy set on wrong direction, attribute not propagated as assumed, path filtered before selection or tie-break misunderstood.

Step 7 Troubleshooting workflow Narrow the fault

1. Pick one exact prefix and the router that makes the decision.

2. Confirm the expected neighbours are Established and that each one actually sent the prefix (show ip bgp neighbors <ip> routes).

3. show ip bgp <prefix>: are all expected paths present and valid? If not, the problem is NEXT_HOP reachability, inbound policy or an AS loop — not path selection.

4. Walk the decision order and find the first attribute that differs. Is that the attribute your design meant to decide?

5. If BGP picks the right path but traffic does not follow it, check show ip bgp rib-failure, show ip route <prefix> and show ip cef <prefix>.

6. Change one policy, soft-refresh the neighbour (clear ip bgp <ip> soft in) and repeat steps 3–5.

Typical causes: route-map applied in the wrong direction, an attribute that does not propagate where you expected (Weight never leaves the router, LOCAL_PREF never leaves the AS), MED compared across different neighbouring ASes, or a NEXT_HOP that iBGP peers cannot resolve.

Step 8 Troubleshoot one prefix through the policy chain Narrow the fault

Use a specific prefix, not only show ip bgp summary. Verify it is received or originated, inspect policy matches, compare the attributes of all candidates, identify the BGP best path, then check RIB installation and recursive forwarding. If the peer is Established but the prefix is missing, troubleshoot advertisement/policy rather than resetting the session blindly.

Evidence references

Evidence · 4 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

other · 4
Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic BGP Path Attributes Reference

BGP Path Attributes Reference is an operational deep-reference Topic for 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. Supplements its older compact reference sections with explicit state ownership, verification, failure signatures and closure proof.

Subtopic BGP Best-Path Reference

BGP selects one or more best paths from valid candidates using ordered policy and path attributes, then offers the result to the RIB.

Subtopic Best Path

Best Path is treated as a specific BGP operational boundary. This reference documents ordered BGP path selection among eligible candidates rather than a single-attribute decision such as shortest AS_PATH with explicit state ownership, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic AS_PATH

AS_PATH is treated as a specific BGP eBGP operational boundary. This reference documents AS_PATH as both inter-AS loop-prevention state and a policy-visible path attribute whose sequence length and manipulation can influence best-path selection with explicit protocol state, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic NEXT_HOP

NEXT_HOP is treated as a specific BGP operational boundary. This reference documents the BGP NEXT_HOP attribute and its recursive reachability dependency between learned control-plane paths and usable forwarding with explicit state ownership, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic LOCAL_PREF

LOCAL_PREF is treated as a specific BGP eBGP operational boundary. This reference documents LOCAL_PREF as an AS-internal outbound-exit preference, normally propagated to iBGP peers and evaluated with higher values preferred before AS_PATH/MED decisions with explicit protocol state, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic MED

MED is treated as a specific BGP eBGP operational boundary. This reference documents the Multi-Exit Discriminator as a neighboring-AS ingress hint, with lower values generally preferred where comparison rules make the candidates eligible to be compared with explicit protocol state, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic Weight

Weight is treated as a specific BGP eBGP operational boundary. This reference documents Cisco-local BGP Weight as a non-advertised per-router preference, with higher values preferred and no automatic consistency across other routers in the AS with explicit protocol state, verification, failure signatures and closure proof instead of relying on generic parent text.

Subtopic Origin

Origin is treated as a specific BGP eBGP operational boundary. This reference documents the BGP ORIGIN attribute and its IGP, EGP and incomplete codes, including how route origination method influences the attribute without describing the underlying IGP protocol itself with explicit protocol state, verification, failure signatures and closure proof instead of relying on generic parent text.

Key points

BGP selects among paths using attributes and reachability, not simply the numerically shortest network path. In Cisco-oriented study, reason through locally significant attributes such as weight/local preference, locally originated paths, AS-path length, origin, MED and eBGP/iBGP distinctions before later tie-breakers.

Always verify that the BGP next hop is reachable in the relevant routing table. A 'best' path that cannot resolve a next hop does not provide usable forwarding.

Key checks
  • show ip route — Display IPv4 routing table. Proves which routes are installed in the local RIB and exposes prefix, source, next hop, AD/metric and default-route state.
  • show ip cef — Inspect FIB/CEF forwarding entries. Shows FIB/CEF forwarding entries and how a destination prefix resolves toward an interface/next hop.
  • show ip bgp summary — Check BGP neighbor session state and prefix counts. Shows BGP peer session state, peer AS, uptime and prefix-count/state summary for an address family.
  • show ip bgp — Inspect BGP paths and attributes. Shows BGP candidate paths, next hop and path attributes and identifies the locally selected best BGP path.
  • Symptom: The expected prefix appears in BGP output, yet forwarding does not reach the destination. → BGP path selected but traffic still fails
ReferenceWhat it is1 section · depth on demand

Concept overview

When BGP learns more than one valid path to the same prefix, it must choose one to use and advertise. Unlike an IGP it does not pick the lowest cost: it compares path attributes in a fixed order — Weight, LOCAL_PREF, local origination, AS_PATH length, ORIGIN, MED, eBGP over iBGP, IGP metric to the next hop, then tie-breakers — and stops at the first difference.

That order is what makes BGP a policy protocol. Operators steer traffic by setting the earliest attribute whose scope fits the goal: LOCAL_PREF to choose the exit for the whole AS, Weight to override one router, AS_PATH prepending or MED to ask a neighbour to prefer a particular entry.

The child Topics go deeper: Best Path for the full decision order and troubleshooting, BGP Best-Path Reference for a three-router lab, and one Topic per attribute.

ReferenceWhy it matters1 section · depth on demand

Why it matters

BGP compares attributes in an ordered decision process to select a best path; policy should manipulate the earliest appropriate attribute for the intended scope.

ReferenceHow it works2 sections · depth on demand

How it works

For every prefix BGP keeps all received paths in its table, marks the valid ones, and runs the decision process whenever a path is added, withdrawn or changes. The winner gets the > (best) marker in show ip bgp and is offered to the routing table and advertised to peers (subject to outbound policy). Losing paths stay in the BGP table as backups, which is why failover is fast when the best path disappears: the next candidate is already there.

Policy pipeline before best-path selection

BGP learning is a pipeline: the peer session must be established, a prefix must be received/originated, inbound policy decides whether it is accepted and can modify attributes, best-path selection compares eligible paths, and only then can the selected BGP path compete for RIB installation.

Attributes have different scope and intent. Weight is Cisco-local, Local Preference influences outbound choice across an AS, AS_PATH expresses path history/loop prevention and can influence preference, MED is a hint between neighboring ASes under defined comparison rules, and next-hop reachability remains mandatory for practical forwarding.

ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

Cisco's BGP best-path algorithm

When BGP has several paths to the same prefix, Cisco IOS compares them in a fixed order and stops at the first difference. Cisco's best-path document lists the steps:

1. Highest weight (Cisco-only, local to the router).

2. Highest LOCAL_PREF (default 100).

3. Locally originated, preferring network or redistribution over aggregates. AIGP is also considered here when configured.

4. Shortest AS_PATH (an AS_SET counts as one).

5. Lowest origin (IGP before EGP before incomplete).

6. Lowest MED, compared only between paths from the same neighbouring AS.

7. eBGP over iBGP.

8. Lowest IGP metric to the next hop.

9. Multipath decision.

10. Oldest eBGP path.

11. Lowest router ID (the ORIGINATOR_ID for reflected routes).

12. Shortest cluster list.

13. Lowest neighbour address.

Options that change the algorithm (document)

CommandEffect
bgp always-compare-medCompare MED between paths from different ASes; must be consistent across the AS
bgp deterministic-medGroup paths by neighbouring AS before comparing MED
bgp bestpath as-path ignoreSkip the AS_PATH length step
bgp bestpath compare-routeridSkip the "oldest path" step and use the router ID
bgp default local-preference <n>Change the default LOCAL_PREF

Finding the deciding step

Compare the best path and the runner-up one attribute at a time, in the algorithm's order. The first attribute that differs explains the choice.

Best pathRunner-upDeciding step
localpref 200localpref 1002 (LOCAL_PREF)
AS_PATH 64500AS_PATH 64501 645024 (AS_PATH length)
externalinternal7 (eBGP over iBGP)
metric to next hop 11metric 218 (IGP metric)
Received firstReceived later, both eBGP10 (oldest path)
R1# show bgp ipv4 unicast 192.0.2.0/24
BGP routing table entry for 192.0.2.0/24, version 8211
Paths: (3 available, best #2, table default)
  64501 64496
    198.51.100.9 from 198.51.100.9 (198.51.100.9)
      Origin IGP, metric 0, localpref 100, valid, external
  64500 64496
    203.0.113.1 from 203.0.113.1 (203.0.113.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
  64500 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# show bgp ipv4 unicast 192.0.2.0/24 bestpath

Reading the example

All three paths have equal LOCAL_PREF, AS_PATH length and origin. The internal path loses at step 7 (eBGP over iBGP). Between the two external paths, the MEDs aren't compared because they come from different ASes, so step 10 picks the older path. That is usually the one received first.

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.

Quick reference

BGP path selection compares all valid paths for a prefix step by step and stops at the first difference. Before the comparison, a path must be valid: its NEXT_HOP must be reachable, it must pass inbound policy and must not contain the local AS.

OrderAttributePreference
1Weight (Cisco, local)Highest
2LOCAL_PREFHighest
3Locally originatedPreferred
4AS_PATH lengthShortest
5ORIGINIGP < EGP < incomplete
6MEDLowest (same neighbor AS by default)
7eBGP over iBGPeBGP
8IGP metric to NEXT_HOPLowest
9+Oldest eBGP path, lowest router ID, shortest CLUSTER_LIST, lowest neighbor addressTie-breakers

AIGP (when enabled) sits between local origination and AS_PATH; see Best Path for the complete Cisco order with notes.

show bgp ipv4 unicast 203.0.113.0/24

Documented example, not captured output.

Use LOCAL_PREF to steer outbound traffic and AS_PATH prepending or MED to influence inbound traffic.

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

Best path is not the same as forwarding path

show ip bgp <prefix> can identify the best BGP candidate. The RIB can still prefer another protocol for the same prefix because of administrative distance, and CEF still must recursively resolve the selected RIB next hop. This is why BGP Established → BGP best → RIB → CEF should be treated as separate evidence boundaries.

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 4271Primary and backup exit: prefer routes from 192.0.2.2 across the AS with LOCAL_PREF, and make the backup link less attractive inbound with AS_PATH prepending

Assumptions: Lab addressing; local AS 65000; both eBGP neighbours Established; route-refresh supported.

route-map FROM-PRIMARY permit 10
 set local-preference 200
route-map TO-BACKUP permit 10
 set as-path prepend 65000 65000
!
router bgp 65000
 address-family ipv4 unicast
  neighbor 192.0.2.2 route-map FROM-PRIMARY in
  neighbor 192.0.2.6 route-map TO-BACKUP out
!
! then: clear ip bgp * soft

Expected output

Cisco IOS / IOS XE RFC 4271show ip bgp

Expected state: One path per prefix carries `>`; the attribute columns explain why.

Network          Next Hop            Metric LocPrf Weight Path
 *>  203.0.113.0/24   192.0.2.2                0    200      0 65010 65030 i
 *                    192.0.2.6                0             0 65020 i
! Illustrative output, not captured Evidence.
`*` = valid, `>` = best. The first path wins on LocPrf 200 (a blank LocPrf on an eBGP path means the default 100) even though its AS_PATH is longer. The trailing `i` is ORIGIN IGP, not iBGP.
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 BGP → BGP Path Selection. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Useful command sets

Commands commonly referenced together

Compact reference collections only; they are not a guided troubleshooting workflow.

IOS/IOS XE BGP prefix path bundle

Session → prefix → RIB → forwarding

Use when a BGP peer or one exact prefix is in question.
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 best pathBGP local prefLocal PreferenceAS_PATHMEDBGP Local PreferenceBGP path attributes
Embedded reference data

Quick lookup tables

BGP path-selection factors

Common IOS/IOS XE path-selection factors used when comparing eligible BGP paths.

FactorTypical preferenceBoundary
WeightHigherLocal to one Cisco router
Local PreferenceHigherPropagated inside the AS; common outbound-exit policy
Locally originatedPreferredLocal origination can outrank learned alternatives
AS_PATHShorterOnly after higher-priority factors are equal
OriginIGP < EGP < incompleteOne later comparison factor
MEDLowerComparison rules/context matter
eBGP vs iBGPeBGP preferredLater than the attributes above
IGP metric to next hopLowerRequires usable next-hop reachability

BGP session states

Fast FSM reference when the peer is not Established.

StateMeaningUseful next boundary
IdleInitial/restart state; no established transportNeighbor config, routing and TCP prerequisites
ConnectWaiting for TCP connection resultIP/TCP reachability to peer
ActiveTCP/session establishment is retryingReachability, ACL/firewall, update-source, peer address/AS
OpenSentOPEN sent; waiting/processing peer OPENAS number, capabilities, authentication/context
OpenConfirmOPEN accepted; keepalive confirmation pendingSession stability / keepalive exchange
EstablishedBGP messages and NLRI can be exchangedExact prefix → policy → best path → RIB → CEF
Embedded quick reference

Operational notes

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

BGP command cheat sheet

Session → prefix → RIB → forwarding

1. show ip bgp summary — session state only.

2. show ip bgp <prefix> — candidate paths, attributes and best path.

3. show ip route <prefix> — whether a route is installed in the RIB.

4. show ip cef <destination> — recursive forwarding state.

Established does not prove that the required prefix exists or forwards.

BGP neighbor config skeleton

Basic eBGP peer reference with explicit verification

router bgp 65000
 neighbor 192.0.2.2 remote-as 65001

Then prove IP/TCP reachability and inspect show ip bgp summary. An Established session still does not prove the required prefix is present, selected or forwardable.

BGP Attributes Fast Check

Scope og operational meaning for common best-path attributes.

AttributePractical scopeTypical effect
WeightOne Cisco routerHigher preferred
Local PreferenceInside ASHigher preferred
AS_PATHInter-AS path historyShorter often preferred later in decision chain
OriginPath metadataIGP before EGP before incomplete
MEDHint to neighboring ASLower often preferred in eligible comparison
Next hopReachability dependencyMust resolve before useful forwarding

Husk

Never troubleshoot one attribute without confirming policy, eligibility, next-hop resolution, RIB and CEF.

Depth when you need it

Deep reference

Healthy vs suspicious evidence

How to read the evidence

Anchor the same prefix/neighbor across protocol input, policy/selection, RIB and forwarding state before testing packets. Verification: Verify the same prefix at received, accepted, best-path, RIB and FIB layers; then verify next-hop resolution and the actual forwarding flow instead of relying on Established alone.

Design & tradeoffs

ENCOR design tradeoffs

Choose policy attributes based on scope: local preference influences outbound exit across an AS; AS-path prepending commonly influences external inbound preference.

Confirmation

Confirm action

Continue?