Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

NEXT_HOP

Direct answer

NEXT_HOP is the IP address a BGP route says traffic should be sent to. The router must be able to reach it through its routing table; otherwise the path is unusable. iBGP keeps the eBGP next hop unless next-hop-self is set.

When to use this

Use it when a BGP path is in the table but is not chosen or not installed, or when the route exists and traffic is still dropped — typically an iBGP router that has no route to the external next hop.

First 30 seconds

1. show ip bgp <prefix> — read the NEXT_HOP on the best path.

2. show ip route <next-hop> — must resolve, or the path is unusable.

3. iBGP learned from eBGP keeps the external next hop unless next-hop-self is set.

Operational verification

path received → NEXT_HOP resolves in the RIB (otherwise the path is unusable) → best path → route installed → CEF recursion to interface and adjacency → traffic

Evidence · next step

Repair/verify route to NEXT_HOP, then re-check best path and RIB installation.

Continue only after interpreting the current observation.
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
Key commandneighbor <peer> next-hop-self
Scope / prerequisiteUse it when a BGP path is in the table but is not chosen or not installed, or when the route exists and traffic is stil…
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

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

7 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 First 30 seconds Verify boundary

Immediate answer: For one prefix, show the selected BGP NEXT_HOP recursively resolves to a usable adjacency before changing BGP policy.

Verification chain: BGP candidate → selected path → NEXT_HOP → RIB recursion → CEF adjacency → egress → return path

Stop condition: A best BGP path is not forwardable when its NEXT_HOP cannot resolve to a usable data-plane adjacency.

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

In the BGP view, the address at the start of each path line is the next hop, and (inaccessible) after it means the lookup failed. The route lookup for the next hop shows how it resolves and through which source. CEF shows the outcome of the whole recursion: one next hop and one interface.

Known-good: no path is marked inaccessible, the next hop resolves through an IGP or connected route, and CEF points out of the expected interface.

Step 3 Verification and output interpretation Verify boundary

For an affected prefix, inspect the BGP NEXT_HOP, then perform an exact route lookup for that address and verify CEF adjacency resolution. A valid BGP path with an inaccessible next hop is not equivalent to an installed, forwardable route. When using next-hop-self, confirm the attribute changed on the advertised route, not merely that the command exists in configuration.

Step 4 Step-by-step troubleshooting Narrow the fault

2. Walk this chain: BGP candidate → selected path → NEXT_HOP → RIB recursion → CEF adjacency → egress → return path.

Boundary rule: A best BGP path is not forwardable when its NEXT_HOP cannot resolve to a usable data-plane adjacency.

Step 5 Verification & troubleshooting Narrow the fault

1. show ip bgp <prefix> → the next hop of each path; look for (inaccessible).

2. show ip route <next-hop> → is there a route, and from which source?

3. If not: note which iBGP peer sent the path (from …) and add next-hop-self there, or advertise the external subnet into the IGP.

4. show ip cef <prefix> → the interface the traffic finally uses.

5. ping <next-hop> to confirm it answers.

Step 6 Failure signatures and troubleshooting branches Narrow the fault
  • (inaccessible) and no best path on internal routers. next-hop-self is missing on the edge, or the external subnet is not in the IGP.
  • Route is valid and best, but packets are dropped at a router along the way. A router between this one and the next hop does not run BGP and has no route for the destination. Every router on the path needs the route (or the core needs MPLS).
  • Next hop resolves through an unexpected route. A default route or a tunnel is catching it; check show ip route <next-hop>.
  • The route flaps every minute or so. The next hop is being resolved through the BGP route itself; give it a more specific IGP or static route.
  • After introducing a route reflector, clients cannot use each other's routes. The reflector does not change the next hop; clients must be able to reach each other's next-hop addresses.
Step 7 When the problem is really fixed Narrow the fault
  • No path for the prefix is marked (inaccessible).
  • show ip route <next-hop> returns an IGP, static or connected route on every router that uses the path.
  • BGP best path, routing table and CEF agree.
  • A ping or traceroute to the destination follows the resolved path.
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.

command output · 1
Command lookup Jump straight to Cisco syntax
Key points

A path whose NEXT_HOP cannot be resolved in the routing table is not usable and is never chosen as best. eBGP sets NEXT_HOP to the advertising router; iBGP leaves it unchanged, so either set next-hop-self on the edge router or carry the external link subnet in the IGP.

Key checks

show ip bgp <prefix> → NEXT_HOP per path; look for (inaccessible). show ip route <next-hop> → must resolve to a real route. show ip cef <prefix> → the outgoing interface after recursion.

ReferenceWhat it is2 sections · depth on demand

BGP scope — internal and external paths

NEXT_HOP is required for classic IPv4 unicast internal and external routes and must recursively resolve to a usable local forwarding path. An edge normally preserves an external next hop when advertising a route through iBGP. Transport reachability to the iBGP peer does not prove that this preserved next hop resolves. Follow Next-Hop-Self for the ordinary edge rewrite and the Cisco RR all exception. Reflection normally preserves the edge next hop; the immediate BGP peer need not be the traffic next hop.

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

What it is

NEXT_HOP is the IP address a router has to send packets to in order to use a BGP route. Unlike the next hop of an IGP route it does not have to be a directly connected neighbour: the router looks the address up in its own routing table to find the real outgoing interface.

ReferenceWhy it matters1 section · depth on demand

Why it matters

A path can be perfect in every other respect and still be unusable because of this one attribute. If a router cannot resolve the next hop, the path is not even considered. The classic case is in iBGP: external routes arrive at the edge router and are passed to the internal routers with the next hop unchanged — an address on the external link that the internal routers have no route to. It is the most common reason for "the route is in the BGP table but not in the routing table".

ReferenceHow it works1 section · depth on demand

NEXT_HOP bridges BGP and forwarding

BGP can hold and even select a path whose next-hop handling becomes the next operational boundary. After identifying the best path, verify recursive reachability to NEXT_HOP and the resulting RIB/CEF state before changing BGP attributes.

ReferenceImportant terms & boundaries6 sections · depth on demand

Key points

  • Advertised to an eBGP neighbour: the next hop is the sender's own address on that session.
  • An eBGP-learned route passed on over iBGP: the next hop is left unchanged.
  • A next hop that cannot be resolved makes the path inaccessible; it cannot become best.
  • Fix A: neighbor <iBGP peer> next-hop-self on the edge router.
  • Fix B: carry the external link subnet in the IGP.
  • Route reflectors do not change the next hop.
  • The IGP cost to the next hop is itself a best-path step (lower wins).
  • The next hop must resolve through an IGP, static or connected route — never through the BGP route it belongs to.

In depth

NEXT_HOP must be reachable before a path can be used

Cisco's best path selection document says the comparison only considers paths whose next hop is reachable. The next hop is the address traffic is forwarded to for that prefix. It has to resolve through the routing table (IGP, static or connected).

Session typeDefault NEXT_HOP behaviour
eBGPThe advertising router sets itself as next hop
iBGPThe next hop is passed on unchanged, so iBGP peers see the external peer's address

That iBGP default is why an internal router can show a BGP route as unusable: it has no route to the external next hop.

R2# show ip bgp 203.0.113.0/24
  64511
    192.0.2.5 (inaccessible) from 10.0.0.1 (10.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal
R1(config)# router bgp 64500
R1(config-router)# neighbor 10.0.0.2 next-hop-self
R2# show ip bgp 203.0.113.0/24 | include from
    10.0.0.1 from 10.0.0.1 (10.0.0.1)
R2# show ip route 10.0.0.1

Two fixes

FixEffect
next-hop-self on the edge router towards iBGP peersInternal routers use the edge router's (loopback) address
Advertise the external link subnet into the IGPInternal routers can reach the original next hop

next-hop-self is the usual choice, because the external link subnet then doesn't have to be in the IGP.

Next hop and selection

Step in the orderRole of next hop
Before comparisonUnreachable next hop = path ignored
Step 8Lowest IGP metric to the next hop wins (hot-potato routing)

Troubleshooting

SymptomCheck
(inaccessible) in show ip bgpRoute to the next hop missing in show ip route
Route learned but not in the RIBNext hop recursion failure, or a better administrative distance from another protocol
Traffic black-holedNext hop resolves via a default route that points back the wrong way

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

NEXT_HOP is the address a BGP route says to forward traffic to. eBGP sets it to the advertising router's address; iBGP keeps it unchanged, so internal routers must have a route to the external next hop, or the edge router sets next-hop-self.

neighbor 10.255.255.2 remote-as 65010
neighbor 10.255.255.2 next-hop-self
show bgp ipv4 unicast 203.0.113.0/24 | include Next|from

Documented example, not captured output.

A BGP path with an unreachable next hop is not valid and never becomes best.

Mechanics and state ownership

The rules for what the next hop is set to follow from who is expected to know what. An eBGP neighbour is normally on the same link, so the sender names its own address there. Inside an AS the assumption is that the IGP knows every internal address, so iBGP passes routes on without touching the next hop — which goes wrong precisely when the address is on an external link that the IGP does not carry.

Using a BGP route therefore takes two lookups. The BGP route gives the next-hop address; a second lookup for that address gives an IGP or connected route with an interface; ARP then gives the MAC address. In show ip bgp <prefix> the value in (metric N) after the next hop is the IGP cost of that second lookup.

next-hop-self makes the edge router put its own address — usually its loopback — in place of the external one. Internal routers then only need to reach the edge router's loopback, which the IGP carries anyway. This is why it is the standard choice.

State model and selection mechanics

NEXT_HOP is carried with the route and ties BGP reachability to the underlying routing system. eBGP advertisement behavior commonly sets a next hop reachable from the receiving external peer, while iBGP can preserve an externally learned next hop. This is why an iBGP route may exist in the BGP table but remain unusable until the IGP or static routing can reach that next-hop address. next-hop-self is a common policy tool when an internal speaker should become the resolvable next hop.

Limits and common misconceptions

NEXT_HOP is a forwarding dependency, not the final destination. Ping to the next hop can show some underlay reachability but not that the advertised destination is reachable beyond it. Conversely, a next hop may be resolved recursively through several routes, so the displayed address alone does not reveal the final egress interface or adjacency.

ReferenceConfiguration & state1 section · depth on demand

Policy and configuration model

Design next-hop behavior together with the IGP/underlay. If iBGP peers do not have reachability to external next hops, either provide that reachability or intentionally rewrite the next hop at the correct boundary. Avoid recursive designs where the path to the BGP next hop itself depends on the very route being resolved.

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 4271Edge router rewrites NEXT_HOP to its own address toward iBGP peer 10.0.0.2 so internal routers do not need a route to the external link

Assumptions: Lab addressing; local AS 65000; iBGP session between loopbacks already Established and loopbacks carried in the IGP.

router bgp 65000
 neighbor 10.0.0.2 remote-as 65000
 neighbor 10.0.0.2 update-source Loopback0
 address-family ipv4 unicast
  neighbor 10.0.0.2 next-hop-self
!
! then: clear ip bgp 10.0.0.2 soft out

Expected output

Cisco IOS / IOS XE RFC 4271show ip bgp 203.0.113.0 255.255.255.0

Expected state: Failure signature on an internal router before the fix: the only path is not best because its NEXT_HOP is inaccessible.

BGP routing table entry for 203.0.113.0/24
Paths: (1 available, no best path)
  65010
    192.0.2.2 (inaccessible) from 10.0.0.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal
! Illustrative output, not captured Evidence.
NEXT_HOP 192.0.2.2 is the external neighbour's address, passed on unchanged by iBGP peer 10.0.0.1. This router has no route to 192.0.2.0/30, so the path cannot be used. After `next-hop-self` on 10.0.0.1 the next hop becomes 10.0.0.1 and the path is marked best.
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 → BGP → eBGP → NEXT_HOP. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
2026-09-13 · vendor docCisco IOS XE current

Official Cisco vendor documentation reviewed for bounded reference claims: BGP NEXT_HOP and reachability boundary. This is documentation-based technical verification, not lab or production-runtime proof. Deployment-specific applicability and runtime outcome remain separate evidence.

Basis: https://www.cisco.com/c/en/us/td/docs/routers/ios-xe/ip-routing/b-ip-routing/m_irg-overview-0.html · confidence 94%
Embedded reference data

Quick lookup tables

NEXT_HOP · routing reference

Compact path-selection and evidence boundaries for fast lookup.

LayerCheck
BGPNEXT_HOP attribute
RIBRoute to next hop
CEFRecursive resolution / adjacency
End-to-endDestination and return path

NEXT_HOP operational reference

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

BoundaryKnown-good for NEXT_HOPSuspicious signatureNext proof
IntentMatches the BGP NEXT_HOP attribute and its recursive reachability dependency between learned control-plane paths and usable forwarding designConfiguration differs from design/peerCompare effective configuration
Control stateStable expected region/role/topology/path statea valid BGP path with inaccessible NEXT_HOP, recursive resolution through the wrong VRF or interface, policy changing next-hop unexpectedly, or a route selected in BGP but not installed because the next hop is unusableInspect protocol detail and adjacent state
ForwardingExpected VLAN/egress/RIB/FIB pathControl state exists but traffic path disagreesMAC/FIB/CEF/adjacency proof
ClosureOriginal test passes for explained reasonSymptom moved, was bypassed or protection disabledRegression test
Confirmation

Confirm action

Continue?