Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Set next-hop

Direct answer

set ip next-hop <address> sends matched packets to that next hop instead of using the routing table. The address should be on a directly connected network.

When to use this

Use it to force selected traffic over a particular link or device.

First 30 seconds

1. show route-map <name> — the set clause and its counter.

2. Is the next hop on a connected network? show ip route <next hop>.

3. show ip arp <next hop> — resolved?

4. Traffic going the normal way → next hop unreachable; add tracking.

5. Confirm with traceroute from a matching source.

Operational verification

route-map applied on the ingress interface → ACL matches the flow → route-map sequence permits → next hop set and reachable → packet forwarded via the policy path; non-matching traffic routed normally

Evidence · next step

Verify route/ARP/CEF to the next hop and platform-specific fallback behavior before changing match logic.

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 / IOS XE
Key commandset ip next-hop <address>
Scope / prerequisiteUse it to force selected traffic over a particular link or device.
Reference · 2
What next?3 suggested next steps
Catalog command links2
Evidence2
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.

2 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: Generate one controlled ingress flow and verify the route-map match plus next-hop reachability before blaming the set action.

Verification chain: ingress interface → ACL/route-map match → set next-hop → next-hop resolution → FIB/egress → return path

Stop condition: A configured set next-hop does not show the packet matched PBR or that the selected next hop is recursively reachable.

Step 2 Common mistakes Narrow the fault
  • Next hop not directly connected (use set ip next-hop recursive if needed).
  • No verify-availability, so traffic is black-holed when the next hop is down.
Evidence references

Evidence · 2 on this Topic

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

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

If the next hop is not reachable, the packet falls back to normal routing — which can hide a failure. Use set ip next-hop verify-availability <address> <seq> track <n> to tie it to a track object. set ip default next-hop is different: it applies only when the routing table has no explicit route.

Key checks
  • show ip policy — interfaces with a policy and the route-map used.
  • show route-map <name> — sequences, matches, set clauses and policy-routed packet counts.
  • show access-lists <acl> — hits on the classifying ACL.
  • show ip cef <next hop> — whether the set next hop is reachable.
  • debug ip policy — per-packet decisions; restrict and use briefly.
ReferenceWhat it is1 section · depth on demand

What it is

set ip next-hop <address> tells PBR to forward matching IPv4 traffic toward a specified next hop rather than simply accepting the next hop selected by the normal destination-route lookup. set interface <interface> is another source-taxonomy forwarding action and must be used only where the interface semantics fit the design.

ReferenceWhy it matters1 section · depth on demand

Why it matters

Use a set action only after the classifier is correct. A correct route-map match with an unusable next hop still does not show traffic can forward, so next-hop reachability and CEF/adjacency remain separate evidence boundaries.

ReferenceHow it works1 section · depth on demand

Set action is not end-to-end proof

After a route-map selects a next hop, forwarding still depends on local adjacency/CEF, downstream routing/policy and the return path. Troubleshooting should therefore stop at the first step that disagrees with the intended flow rather than repeatedly editing the route-map.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

set ip next-hop versus set ip default next-hop

PBR offers two ways to set a next hop, and they differ in when the routing table wins. Cisco's PBR technote explains: with set ip next-hop, the router checks whether the configured next hop is in the routing table, policy-routes to it if so, and uses normal routing if not; with set ip default next-hop, the router checks whether the destination is in the routing table, routes normally if it is, and policy-routes only when it isn't.

Comparison (technote)

set ip next-hopset ip default next-hop
Checked in the routing tableThe configured next hopThe packet's destination
Policy appliesWhenever the next hop is reachableOnly when no route to the destination exists
FallbackNormal routing if the next hop disappearsPolicy next hop when the destination route is missing
Typical useForce traffic to a pathProvide a path only when routing has none

Behaviour from the technote's cases

CaseResult
set ip next-hop, next hop's interface goes downNext hop leaves the table; normal forwarding
set ip default next-hop, specific route to the destination existsNormal forwarding
set ip default next-hop, only a default route existsPolicy-routed, since no specific route matches
R1(config)# route-map PBR-ISP2 permit 10
R1(config-route-map)# match ip address BRANCH-WEB
R1(config-route-map)# set ip next-hop verify-availability 203.0.113.33 10 track 20
R1(config-route-map)# set ip next-hop 198.51.100.1
R1(config)# track 20 ip sla 20 reachability
R1# debug ip policy
IP: s=10.150.0.64 (GigabitEthernet0/0/2.150), d=142.250.74.46, len 60, policy match
IP: route map PBR-ISP2, item 10, permit
IP: s=10.150.0.64 (GigabitEthernet0/0/2.150), d=142.250.74.46 (GigabitEthernet0/0/1), len 60, policy routed

Reachable is not the same as working

A next hop on a connected subnet stays "in the routing table" while the interface is up, even if the device behind it is dead. set ip next-hop verify-availability with an IP SLA track removes it from consideration when probes fail.

Choosing

Use set ip next-hop (with tracking) to steer specific traffic to a specific path; use set ip default next-hop when policy should only fill gaps in the routing table.

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

When PBR matches traffic, the set statements decide where it goes. The main choice is between forcing a next hop regardless of the routing table and using a next hop only when no explicit route exists. Because PBR does not know whether a next hop really works beyond the local link, production policies should be tied to object tracking.

PBR next-hop options:

set ip next-hop 198.51.100.1 203.0.113.1              ! first reachable is used
set ip next-hop verify-availability 198.51.100.1 10 track 10
set ip default next-hop 198.51.100.1                   ! only if no explicit route exists
set vrf INTERNET                                       ! route in another VRF
show ip policy
debug ip policy                                        ! lab only

Without tracking, PBR keeps sending traffic to a next hop that is reachable at Layer 2 but broken further away — combine with IP SLA.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
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 2475

Authoritative/upstream documentation reviewed for bounded claims in Routing → Policy-Based Routing → Set next-hop. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc2475.html · confidence 94%
Confirmation

Confirm action

Continue?