Use it when a router reaches known networks but not "everything else" (typically the Internet), or to see which default route is in use.
Gateway of Last Resort
"Gateway of last resort" in show ip route shows the default route the router is currently using for destinations with no more specific match — normally an installed 0.0.0.0/0 route. "Not set" means there is no default route.
1. show ip route | include Gateway — Gateway of last resort is ….
2. Comes from a static 0.0.0.0/0, default-information originate or a received default.
3. not set means traffic to unknown destinations is dropped.
default route configured or learned → installed as 0.0.0.0/0 (lowest AD) → Gateway of last resort is … → next hop reachable → unmatched destinations forwarded there → return route exists upstream
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip route | include GatewayVerification & 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 Operational verification and known-good state Verify boundary
show ip route | include Gateway
show ip route 0.0.0.0
show ip cef 0.0.0.0/0
show ip route 203.0.113.50
The first line states whether a gateway of last resort is set and what it is. The second shows the default route's source, distance and next hop. CEF shows the resolved interface. Looking up an address the router has no specific route for confirms that it falls through to the default.
Known-good: the gateway of last resort is set to the intended next hop, from the intended source, and an unknown destination resolves to it.
Step 2 Failure signatures and troubleshooting branches Narrow the fault
- "Gateway of last resort is not set" and no access to outside networks. No default route is installed: the static route's next hop is unreachable, or the protocol is not originating a default.
- OSPF does not advertise a default.
default-information originaterequires the router to have a default route itself, unlessalwaysis added. - The default points the wrong way. Another source with lower administrative distance supplied it — commonly DHCP on an interface or a leftover static route.
- Traceroute to an unknown address alternates between two routers. Their defaults point at each other.
- The default works but replies never return. The far side has no route back, or NAT is missing at the edge.
ip default-gatewayis configured on a router that routes. It has no effect when IP routing is enabled.
Step 3 When the problem is really fixed Narrow the fault
show ip routestates the intended gateway of last resort.- The default route comes from the intended source.
- An unknown destination resolves to the default in CEF.
- A sourced ping to an outside address succeeds.
Step 4 Common mistakes Narrow the fault
- No default route on edge routers.
- Two defaults with the same AD causing unexpected load sharing.
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.
show ip route | include Gateway → the current gateway or not set. show ip route 0.0.0.0 0.0.0.0 → source, AD and next hop of the default. show ip cef 0.0.0.0/0 → outgoing interface.
ReferenceHow it works1 section · depth on demand
Quick reference
The gateway of last resort is the router's default route: where packets go when nothing more specific matches. At the network edge it usually points to the internet provider. A backup default with a higher administrative distance can take over automatically, but only if the primary route actually disappears, which is why tracking the real path with IP SLA is often needed.
The gateway of last resort is the default route (0.0.0.0/0) used when no more specific route matches.
ip route 0.0.0.0 0.0.0.0 203.0.113.1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 250 ! floating backup
router ospf 1
default-information originate ! advertise default into OSPF (if one exists)
show ip route | include Gateway of last resort
Track the primary default with IP SLA (ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 10) so failover happens when the ISP fails beyond the directly connected link.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Gateway of last resort
The gateway of last resort is the router's default route: where packets go when nothing more specific matches. show ip route prints it at the top. Cisco's IOS XE routing guide lists the ways to set it: a static ip route 0.0.0.0 0.0.0.0, which needs IP routing enabled; ip default-network to mark a network as candidate default; and, on a device with routing disabled, ip default-gateway.
R1# show ip route | include Gateway|0.0.0.0
Gateway of last resort is 203.0.113.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 203.0.113.1
R2# show ip route | include Gateway|0.0.0.0
Gateway of last resort is 10.0.12.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 10.0.12.1, 00:41:02, GigabitEthernet0/0/1
SW-L2# show ip default-gateway
10.50.0.1
The asterisk marks the candidate default. On R2 the default arrives as an OSPF external route.
Setting and spreading a default
| Method | Where |
|---|---|
ip route 0.0.0.0 0.0.0.0 <next-hop> | Edge router |
default-information originate | OSPF: needed, because OSPF doesn't propagate a static default (routing guide) |
default-information originate always | OSPF, even without a default in the table |
| Redistribute the static default | EIGRP (routing guide) |
ip default-gateway | Layer 2 switch or device with routing disabled |
"Gateway of last resort is not set"
| Cause | Fix |
|---|---|
| No default route | Configure or learn one |
| Next hop unreachable | Check the connected route and interface |
| OSPF default not originated | default-information originate on the edge router |
Design cautions
| Point | Reason |
|---|---|
| Default routes can hide routing gaps | Traffic to unknown internal prefixes heads to the Internet |
| Pair defaults with summary discard routes | Unknown internal destinations are dropped rather than leaked |
| Track Internet defaults | A dead upstream doesn't remove a static default |
Documented example, not captured output.
Mechanics and state ownership
The gateway of last resort is the next hop of the default route — the route 0.0.0.0/0, which matches every destination and, having the shortest possible prefix, is used only when nothing more specific matches. The first lines of show ip route state it: Gateway of last resort is 192.0.2.1 to network 0.0.0.0, or is not set.
A default route can come from several places: a static ip route 0.0.0.0 0.0.0.0 <next hop>, a routing protocol (OSPF default-information originate, an EIGRP or BGP default), or DHCP on an edge interface. If several sources offer one, administrative distance decides, as for any prefix. The chosen default is marked with an asterisk, for example S*.
Without a default route, a packet to an unknown destination is dropped and the sender gets an unreachable message. With one, it is sent to the gateway — whether or not the gateway can do anything with it. Two routers that each point their default at the other will bounce unknown traffic between them until the TTL runs out.
On a Layer 2 switch, which does not route, ip default-gateway serves the same purpose for the switch's own management traffic only.
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: Lab devices; addresses and interface names are examples.
ip route 0.0.0.0 0.0.0.0 192.0.2.1Expected output
show ip routeExpected state: Gateway line set and a default route flagged with *.
Gateway of last resort is 192.0.2.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.0.2.1
C 192.0.2.0/30 is directly connected, GigabitEthernet0/1
! Illustrative output, not captured Evidence.`S*` = static route that is the candidate default. The gateway 192.0.2.1 is on the connected network of Gi0/1, so the default resolves in one step.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 → Gateway of Last Resort. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
Gateway of Last Resort operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Boundary | Known-good for Gateway of Last Resort | Suspicious signature | Next proof |
|---|---|---|---|
| Intent | Matches IPv4 default-route selection design | Configuration differs from peer/design | Compare effective config |
| Control state | Stable expected role/route/member state | no gateway of last resort when fallback is expected, a stale/wrong default winning, recursive resolution failure, or successful next-hop ping while remote destinations still fail | 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 |