Use it to force selected traffic over a particular link or device.
Set next-hop
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.
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.
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
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
Operational reference
Fast context before you go deeper.
set ip next-hop <address>Primary Commands
Configuration and operational commands for this Topic.
set ip next-hop <address>ReferenceSend PBR-matched traffic to a specific next hop.
Use when: Steer matching traffic toward a deliberate next hop.
Quick note: Verify match counters first, then next-hop reachability and forwarding evidence.
Cisco IOS / IOS XE · mixed · configuresset interface <interface>ReferenceSend PBR-matched traffic out a specific interface.
Use when: Use interface-based steering only when the link/media and design make that forwarding action appropriate.
Quick note: Validate interface state, adjacency requirements and the real forwarding result.
Cisco IOS / IOS XE · mixed · configuresVerification & 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 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 recursiveif needed). - No verify-availability, so traffic is black-holed when the next hop is down.
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.
The configured set next hop cannot be resolved/reached through the expected local forwarding context.
command output · Evidence referencePBR matches and local next hop is usable but application still failsThe intended route-map sequence increments and local next-hop adjacency/forwarding is healthy during the test.
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.
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.
ReferenceHow it works1 section · depth on demand
Set action is not end-to-end proof
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-hop | set ip default next-hop | |
|---|---|---|
| Checked in the routing table | The configured next hop | The packet's destination |
| Policy applies | Whenever the next hop is reachable | Only when no route to the destination exists |
| Fallback | Normal routing if the next hop disappears | Policy next hop when the destination route is missing |
| Typical use | Force traffic to a path | Provide a path only when routing has none |
Behaviour from the technote's cases
| Case | Result |
|---|---|
set ip next-hop, next hop's interface goes down | Next hop leaves the table; normal forwarding |
set ip default next-hop, specific route to the destination exists | Normal forwarding |
set ip default next-hop, only a default route exists | Policy-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.
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.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
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 → 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%