Use it when internal routers drop eBGP-learned routes because they cannot resolve the external next hop.
Next-Hop-Self
next-hop-self advertises the local router as NEXT_HOP for eligible updates to a neighbor. Use it at an AS edge when internal routers cannot resolve the external next hop. On a Cisco RR, rewriting reflected iBGP next hops requires the documented all keyword on releases that support it.
1. show ip bgp 203.0.113.0/24
2. show ip route 192.0.2.2
3. show ip route 10.0.0.1
4. show ip route 203.0.113.0
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show bgp ipv4 unicast rib-failureShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show bgp ipv4 unicast rib-failureShowDisplay BGP paths that were not installed in the IP routing table due to RIB-selection conditions.
Cisco IOS XE · mixedshow ip route [prefix]ShowDisplay IPv4 routing table.
Use when: Routing and forwarding verification.
Quick note: Use with show ip protocols for dynamic routing.
IOS/IOS XE · mixedHow to read the output
show bgp ipv4 unicast rib-failureLook 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.
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 Verification — read-only Verify boundary
show ip bgp 203.0.113.0/24
show ip route 192.0.2.2
show ip route 10.0.0.1
show ip route 203.0.113.0
show ip cef 203.0.113.0/24
show ip bgp rib-failure
Compare path detail on the receiving peer before/after the intended advertisement change. Inspect the advertised NEXT_HOP there, then its recursive route and CEF entry. RIB-failure concerns installation of a selected route; it is not synonymous with unreachable NEXT_HOP.
Step 2 Failure Signatures Narrow the fault
- Established but inaccessible next hop: transport succeeds while route recursion fails.
- RR still sends external-edge next hop after next-hop-self: the route was learned through iBGP and reflected; inspect all support and design.
- New next hop is reachable but traffic dies at RR: RR is not able or intended to forward that destination.
- Best BGP path absent from RIB: inspect a lower-distance static/IGP winner rather than assuming next-hop-self failed.
Configuration presence does not prove an update was regenerated or accepted. A changed attribute proves the local path view, not global convergence. Reachable recursion and CEF programming are necessary local checks, not proof of a working end-to-end flow.
show ip bgp 203.0.113.0/24
show ip route 192.0.2.2
show ip route 10.0.0.1
show ip route 203.0.113.0
show ip cef 203.0.113.0/24
show ip bgp rib-failure
Compare path detail on the receiving peer before/after the intended advertisement change. Inspect the advertised NEXT_HOP there, then its recursive route and CEF entry. RIB-failure concerns installation of a selected route; it is not synonymous with unreachable NEXT_HOP.
ReferenceWhat it is1 section · depth on demand
Direct Answer
next-hop-self advertises the local router as NEXT_HOP for eligible updates to a neighbor. Use it at an AS edge when internal routers cannot resolve the external next hop. On a Cisco RR, rewriting reflected iBGP next hops requires the documented all keyword on releases that support it.
ReferenceHow it works1 section · depth on demand
Technical Mechanics
For classic IPv4 unicast, an eBGP path via 192.0.2.2 may be advertised over iBGP from edge 10.0.0.1 with NEXT_HOP still 192.0.2.2. An internal router may reach 10.0.0.1 for TCP but have no route to 192.0.2.2. That candidate fails recursive next-hop eligibility; raising LOCAL_PREF cannot repair resolution.
Setting next-hop-self toward the internal peer changes the advertised next hop to the local peering address, typically the update-source loopback. The underlay must resolve that address. This changes potential egress and IGP-cost comparisons; the advertising router must actually be able to forward the traffic. RIB competition, CEF programming and return policy still apply.
Reflection normally preserves NEXT_HOP. Cisco documents that an RR’s neighbor next-hop-self without all rewrites eBGP-learned paths, while next-hop-self all also covers iBGP-learned paths. An RR outside the data path should normally preserve the edge next hop. Rewriting it can force traffic through the RR or break forwarding. RFC 4456 recommends preserving NEXT_HOP, AS_PATH, LOCAL_PREF and MED during reflection.
ReferenceImportant terms & boundaries4 sections · depth on demand
Official Sources
Proof Boundaries
Configuration presence does not prove an update was regenerated or accepted. A changed attribute proves the local path view, not global convergence. Reachable recursion and CEF programming are necessary local checks, not proof of a working end-to-end flow.
Common mistakes
- Setting next-hop-self on the wrong neighbour.
- Forgetting it is needed when the internal peers cannot reach the external next hop.
In depth
next-hop-self makes an iBGP router set itself as the NEXT_HOP when advertising routes it learned from eBGP. Without it, internal routers receive the external peer's address as next hop and need an IGP route to that external subnet; if they lack one, the routes are invalid.
router bgp 65010
address-family ipv4 unicast
neighbor 10.255.255.2 next-hop-self
show bgp ipv4 unicast 203.0.113.0/24 | include Next|from|best
Documented example, not captured output.
| Option | Effect |
|---|---|
next-hop-self | Edge router's update-source becomes next hop |
| Advertise the external link in the IGP | Keeps original next hop reachable |
next-hop-self all (on RRs) | Also changes next hop of reflected routes |
ReferenceConfiguration & state1 section · depth on demand
Configuration — Cisco IOS / IOS XE
On edge 10.0.0.1, add this IPv4-unicast setting toward internal peer 10.0.0.2 to the neighbor configuration from iBGP Neighbor Relationships:
router bgp 65000
address-family ipv4 unicast
neighbor 10.0.0.2 next-hop-self
exit-address-family
Separate RR case, only when the RR is intentionally a forwarding hop and the deployed release supports all: replace the preceding neighbor operation with neighbor 10.0.0.2 next-hop-self all in the same family. Do not assume ordinary next-hop-self covers reflection.
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.
Configuration example
Assumptions: R1 has an eBGP peer 192.0.2.2 and an iBGP peer 10.255.0.2.
router bgp 65001
address-family ipv4
neighbor 10.255.0.2 next-hop-self
exit-address-familyExpected output
show ip bgp 203.0.113.0/24Expected state: On the iBGP peer, the next hop is the border router's loopback, which the IGP can reach.
BGP routing table entry for 203.0.113.0/24, version 91
Paths: (1 available, best #1, table default)
65002
10.255.0.1 (metric 11) from 10.255.0.1 (10.255.0.1)
Origin IGP, metric 0, localpref 100, valid, internal, bestWithout next-hop-self the iBGP peer sees 192.0.2.2 as next hop; if the IGP does not know that link, the route stays inaccessible and is not installed. Illustrative authored output: field layout matches the tool, values will differ in your environment.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.
Deep reference
Healthy vs suspicious evidence
Expected Output — illustrative
Authored illustration; not a device capture. Field wording varies with IOS / IOS XE release.
Before: 203.0.113.0/24 via 192.0.2.2 (inaccessible)
After: *>i 203.0.113.0/24 10.0.0.1 0 100 0 65010 i
RIB: B 203.0.113.0/24 [200/0] via 10.0.0.1
Before/after lines are simplified illustrations. The after path is valid/best because the loopback resolves and the illustrated candidates/policy allow it. [200/0] is the ordinary iBGP administrative-distance/metric display; overrides and competing protocols can change installation.