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.
BGP (Border Gateway Protocol) · Routing Table
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.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show bgp ipv6 unicast summaryShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
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 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
| Symptom | Command | Look for | Next check |
|---|---|---|---|
| Prefix in BGP but not in the RIB | show ip bgp rib-failure | The prefix and the reason | A lower-AD route for the same prefix (often IGP over iBGP) |
| No best path | show ip bgp <prefix> | best marked path | Next hop inaccessible; next-hop-self on iBGP |
| Prefix not received | show ip bgp neighbors <ip> received-routes or soft-reconfig/show bgp ... received | The prefix arrives | Inbound route-map/prefix-list; the peer's advertisement |
| Session down | show ip bgp summary | State/PfxRcd is a number | TCP 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-selfon 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-failureconfirms 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.
networkis 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
Bbut with an unexpected next hop. Best-path selection chose another path; compare the attributes inshow 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 · 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.
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.
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
| Route | Distance | Reason |
|---|---|---|
| eBGP | 20 | Learned from another AS; preferred over IGPs |
| iBGP | 200 | Learned inside the AS; IGPs should win for internal prefixes |
| BGP local (aggregate) | 200 | Generated locally |
From BGP table to routing table
| Step | Detail |
|---|---|
| BGP best path | Chosen by BGP's own algorithm (weight, local preference, AS path, ...) |
| Next hop reachable | iBGP next hops need an IGP or static route |
| Distance comparison | The best path competes with other sources for the RIB |
| RIB failure | Shown 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.
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.
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
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Expected output
show ip route bgpExpected 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.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 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%Quick lookup tables
BGP operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Boundary | Known-good for BGP | Suspicious signature | Next proof |
|---|---|---|---|
| Intent | Matches BGP RIB interpretation design | Configuration differs from peer/design | Compare effective config |
| Control state | Stable expected role/route/member state | a 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 adjacency | Inspect protocol/RIB detail |
| Forwarding | Expected egress/Port-Channel/VLAN path | State exists but traffic path disagrees | FIB/MAC/adjacency |
| Closure | Original test passes for explained reason | Symptom merely moved or was bypassed | Regression test |