Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP (Border Gateway Protocol) · Routing Table

Direct answer

A BGP route must pass several boundaries before it forwards traffic: the path is learned into the BGP table, selected as best, offered to the global/VRF RIB, wins against competing routing sources, and has a resolvable next hop for FIB programming. Cisco default administrative distance commonly favors eBGP at 20 and treats iBGP as 200, but policy and platform context still determine which candidate becomes active.

When to use this

Use it to read BGP entries in show ip route, or when a prefix is best in show ip bgp but traffic does not follow it.

First 30 seconds

1. show ip route bgp — B routes, AD 20 (eBGP) or 200 (iBGP).

2. A best path in show ip bgp but not in the RIB → r RIB-failure or a better-AD route.

3. Check the next hop is reachable.

Operational verification

path in the BGP table → valid (next hop reachable) → best → offered to the RIB → lowest AD wins (eBGP 20, iBGP 200) → B entry → next hop resolved recursively → CEF

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 · IOS/IOS XE
Key commandshow bgp ipv6 unicast summary
Scope / prerequisiteUse it to read BGP entries in show ip route, or when a prefix is best in show ip bgp but traffic does not follow it.
Show · 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.

Operational workflow

Verification & Troubleshooting

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

6 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 Known-good closure and original test Verify boundary

Layered verification for BGP: transport/TCP → Established and negotiated capabilities → target prefix/attributes in received state → local best path → RIB/FIB → advertised state → remote route/forwarding → original flow/return path Close only when the original source, destination, protocol, VRF/VLAN/policy context and return path are tested.

Step 2 Operational verification and known-good state Verify boundary
show ip bgp 203.0.113.0/24
show ip route 203.0.113.0
show ip bgp rib-failure
show ip cef 203.0.113.0/24

The BGP entry lists all paths, marks one best and shows its next hop. The routing table shows whether the installed route for the prefix is B, and through which next hop. rib-failure lists best paths that were not installed and why. CEF shows the resolved next hop and outgoing interface.

Known-good: a best path exists, the routing table shows the prefix as a BGP route with the same next hop, and CEF resolves it to an interface.

Step 3 Troubleshooting BGP routes in the RIB Narrow the fault
SymptomCommandLook forNext check
Prefix in BGP but not in the RIBshow ip bgp rib-failureThe prefix and the reasonA lower-AD route for the same prefix (often IGP over iBGP)
No best pathshow ip bgp <prefix>best marked pathNext hop inaccessible; next-hop-self on iBGP
Prefix not receivedshow ip bgp neighbors <ip> received-routes or soft-reconfig/show bgp ... receivedThe prefix arrivesInbound route-map/prefix-list; the peer's advertisement
Session downshow ip bgp summaryState/PfxRcd is a numberTCP 179 reachability, AS numbers, update-source, ebgp-multihop
Step 4 Failure signatures and troubleshooting branches Narrow the fault
  • A path exists but none is marked best. Its next hop is unreachable; on iBGP, next-hop-self on the border router or carrying the external link in the IGP solves it.
  • A best path exists but the route in the routing table is from another source. Lower administrative distance wins — typical for iBGP (200) against an IGP. show ip bgp rib-failure confirms it.
  • The route is installed but traffic is dropped. The next hop resolves through a route that does not really lead there, or a router along the path does not have the prefix.
  • network is configured but the prefix is not in BGP at all. The exact prefix and mask must be in the routing table first.
  • The route is B but with an unexpected next hop. Best-path selection chose another path; compare the attributes in show ip bgp <prefix>.
Step 5 When the problem is really fixed Narrow the fault
  • The prefix has a best path with a reachable next hop.
  • The routing table shows it as a BGP route, or the RIB failure is understood and intended.
  • CEF resolves it to the expected interface.
  • A sourced traceroute follows the path.
Step 6 Common mistakes Narrow the fault
  • iBGP routes with AD 200 losing to IGP routes.
  • RIB-failure overlooked.
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

B routes have AD 20 when learned from eBGP and 200 from iBGP — so an iBGP route loses to any IGP route for the same prefix. A B line shows only a next-hop address, no interface: the router resolves it recursively through another route. r in show ip bgp (RIB-failure) means another source won the routing table.

Key checks

show ip route <prefix> → source bgp, distance 20 or 200, next hop. show ip bgp <prefix> → best path and its next hop. show ip bgp rib-failure → BGP best paths that were not installed. show ip cef <prefix> → the resolved interface.

ReferenceHow it works1 section · depth on demand

BGP routes in the RIB

BGP offers its best path for each prefix to the RIB. eBGP routes have administrative distance 20, iBGP and locally originated routes 200. A best path is installed only if its next hop is resolvable through another route.

If a route from another source with lower AD (OSPF 110 beats iBGP 200) already exists for the same prefix and length, the BGP path is not installed and is listed as a RIB failure. Longest prefix match across all installed routes still decides forwarding.

ReferenceImportant terms & boundaries3 sections · depth on demand

In depth

BGP routes in the routing table (code B)

BGP routes appear with code B. Cisco's IOS XE routing guide gives their default administrative distances, 20 for external BGP and 200 for internal BGP, and notes that BGP installs one path per prefix by default (maximum-paths changes that).

R1# show ip route bgp
      0.0.0.0/0 [20/0] via 203.0.113.1, 1d02h
B*    0.0.0.0/0 [20/0] via 203.0.113.1, 1d02h
B        10.80.0.0/16 [200/0] via 10.255.0.3, 03:12:11
B        198.51.100.0/24 [20/0] via 203.0.113.1, 1d02h
R1# show ip route 10.80.0.0
Routing entry for 10.80.0.0/16
  Known via "bgp 65010", distance 200, metric 0, type internal
  Routing Descriptor Blocks:
  * 10.255.0.3, from 10.255.0.3, 03:12:11 ago
R1# show ip bgp 10.80.0.0/16 | include best|Local|from

eBGP and iBGP distances

RouteDistanceReason
eBGP20Learned from another AS; preferred over IGPs
iBGP200Learned inside the AS; IGPs should win for internal prefixes
BGP local (aggregate)200Generated locally

From BGP table to routing table

StepDetail
BGP best pathChosen by BGP's own algorithm (weight, local preference, AS path, ...)
Next hop reachableiBGP next hops need an IGP or static route
Distance comparisonThe best path competes with other sources for the RIB
RIB failureShown in show ip bgp when a better-distance route already exists

Guide caution

When redistributing between BGP and an IGP, filter BGP routes before injecting them into the IGP; full Internet tables don't belong in OSPF or EIGRP.

Troubleshooting

A prefix that's in show ip bgp but not in show ip route is usually not best, has an unreachable next hop, or lost on distance (rib-failure).

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 routes appear with code B. eBGP-learned routes have AD 20 and iBGP-learned routes AD 200, so internal IGP routes normally win over iBGP for the same prefix. The next hop of a BGP route must be resolvable through another route (recursive lookup).

show ip route bgp
! B  203.0.113.0/24 [20/0] via 198.51.100.1, 2d03h
! B  10.80.0.0/16 [200/0] via 10.255.255.2, 1d04h

Documented example, not captured output.

If a prefix shows in show bgp as best but not in the routing table, check whether a route with a lower AD exists or the next hop is unreachable.

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

BGP keeps its own table of every path it has received. For each prefix it selects one best path, and only that path is offered to the routing table. Three things must then hold before it forwards traffic.

The next hop must be reachable. A BGP next hop is usually not directly connected, so the router looks it up in the routing table again; a path whose next hop cannot be resolved is not even eligible to be best.

The route must win on administrative distance. eBGP routes have 20 and win against any IGP. iBGP routes have 200 and lose to every IGP — so when a prefix is known through both iBGP and OSPF, the OSPF route is installed and BGP records a RIB failure. That is normal behaviour, not a fault, but it explains many "BGP has it, the router does not use it" cases.

Finally the installed route is resolved to an outgoing interface and programmed into CEF.

In the routing table a BGP route looks like B 203.0.113.0/24 [20/0] via 192.0.2.1: distance 20 means eBGP, 200 means iBGP, and the second number is the MED.

ReferenceConfiguration & state1 section · depth on demand

Reading BGP routes in show ip route

Illustrative output, not captured Evidence:

B     203.0.113.0/24 [20/0] via 192.0.2.1, 3d02h
B     10.50.0.0/16 [200/0] via 10.255.0.2, 1d04h

[20/0] is eBGP AD and MED; [200/0] is iBGP. The via address is the BGP next hop, which must itself resolve in the RIB.

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.

Expected output

Cisco IOS / IOS XEshow ip route bgp

Expected state: eBGP and iBGP routes with their distances.

B        203.0.113.0/24 [20/0] via 192.0.2.2, 01:02:03
B        198.51.100.0/24 [200/0] via 10.0.0.2, 00:40:11
! Illustrative output, not captured Evidence.
`[20/0]` = learned over eBGP; `[200/0]` = learned over iBGP. The second number is the MED. Neither line names an interface — `show ip cef <prefix>` shows where the next hop actually leads.
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 Routing → Routing Table → BGP. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Embedded reference data

Quick lookup tables

BGP operational reference

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

BoundaryKnown-good for BGPSuspicious signatureNext proof
IntentMatches BGP RIB interpretation designConfiguration differs from peer/designCompare effective config
Control stateStable expected role/route/member statea BGP best path absent from the RIB, unresolved NEXT_HOP, a lower-AD IGP/static route winning, or a route installed but forwarding toward the wrong recursive adjacencyInspect protocol/RIB detail
ForwardingExpected egress/Port-Channel/VLAN pathState exists but traffic path disagreesFIB/MAC/adjacency
ClosureOriginal test passes for explained reasonSymptom merely moved or was bypassedRegression test
Confirmation

Confirm action

Continue?