Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Gateway of Last Resort

Direct answer

"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.

When to use this

Use it when a router reaches known networks but not "everything else" (typically the Internet), or to see which default route is in use.

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Cisco IOS / IOS XE
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.

PlatformCisco IOS / IOS XE · Cisco IOS XE · IOS/IOS XE
Key commandshow ip route | include Gateway
Scope / prerequisiteUse it when a router reaches known networks but not "everything else" (typically the Internet), or to see which default…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

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

4 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 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 originate requires the router to have a default route itself, unless always is 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-gateway is 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 route states 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 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.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

The gateway of last resort is the next hop of the installed default route 0.0.0.0/0, marked * as candidate default. It is used only when no more specific route matches. not set means unmatched packets are dropped. The default can be static or learned from OSPF, EIGRP or BGP.

Key checks

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

MethodWhere
ip route 0.0.0.0 0.0.0.0 <next-hop>Edge router
default-information originateOSPF: needed, because OSPF doesn't propagate a static default (routing guide)
default-information originate alwaysOSPF, even without a default in the table
Redistribute the static defaultEIGRP (routing guide)
ip default-gatewayLayer 2 switch or device with routing disabled

"Gateway of last resort is not set"

CauseFix
No default routeConfigure or learn one
Next hop unreachableCheck the connected route and interface
OSPF default not originateddefault-information originate on the edge router

Design cautions

PointReason
Default routes can hide routing gapsTraffic to unknown internal prefixes heads to the Internet
Pair defaults with summary discard routesUnknown internal destinations are dropped rather than leaked
Track Internet defaultsA dead upstream doesn't remove a static default

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.

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
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 XEStatic default route

Assumptions: Lab devices; addresses and interface names are examples.

ip route 0.0.0.0 0.0.0.0 192.0.2.1

Expected output

Cisco IOS / IOS XEshow ip route

Expected 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.
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 docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

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%
Embedded reference data

Quick lookup tables

Gateway of Last Resort operational reference

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

BoundaryKnown-good for Gateway of Last ResortSuspicious signatureNext proof
IntentMatches IPv4 default-route selection designConfiguration differs from peer/designCompare effective config
Control stateStable expected role/route/member stateno 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 failInspect protocol/RIB detail
ForwardingExpected egress/Port-Channel/VLAN pathState exists but traffic path disagreesFIB/MAC/adjacency
ClosureOriginal test passes for explained reasonSymptom merely moved or was bypassedRegression test
Confirmation

Confirm action

Continue?