Default Routes – Complete Guide
1. What Is a Default Route?
A default route is a special routing table entry that matches every possible destination address — it is the route of last resort. When a router receives a packet destined for an address that does not match any more specific entry in its routing table, it forwards the packet according to the default route rather than dropping it.
In IPv4, the default route is written as 0.0.0.0/0 — a network address of
all zeros and a subnet mask of all zeros (prefix length /0). Because the mask has no bits,
it matches every possible IP address with zero bits required to match. In IPv6, the
equivalent is ::/0.
Related pages: Static Route Configuration | Administrative Distance | show ip route | OSPF Overview | EIGRP Overview | RIP Concepts | BGP Overview | IPv6 | Static Routing (Step-by-Step) | Default Route in OSPF (Step-by-Step) | OSPF Single-Area Lab | EIGRP Configuration Lab | Troubleshooting Layer 3 Routing
2. Why Default Routes Are Essential
No router can maintain routing table entries for every possible IP address on the internet (over 900,000 BGP prefixes as of 2025). Default routes solve this practical limitation:
- Edge and branch routers do not need to know every internet route — they just need to know that anything they don't recognise should go toward the internet gateway or upstream provider.
- Internal routers can forward traffic to an aggregation or border router without maintaining a full routing table.
- Stub networks — networks with only one exit point — are perfect candidates for a single default route that covers all outbound traffic.
- Simplicity: A single default route replaces potentially thousands of more specific routes that a router would otherwise need to maintain.
Branch Office Router (Stub Network)
┌─────────────────────────────────────────────┐
│ Routing Table: │
│ │
│ C 192.168.10.0/24 GigabitEthernet0/0 │ ← Local LAN (connected)
│ C 192.168.20.0/24 GigabitEthernet0/1 │ ← Server VLAN (connected)
│ S* 0.0.0.0/0 via 203.0.113.1 │ ← Default route — everything else
│ │
│ Gateway of last resort is 203.0.113.1 │
└─────────────────────────────────────────────┘
Traffic to 10.100.50.5 (corporate HQ):
→ No match for 10.100.50.5 in routing table
→ Falls to default route 0.0.0.0/0
→ Forwarded to 203.0.113.1 (ISP/corporate WAN gateway)
3. Default Route Syntax — All Forms
IPv4 — Three Configuration Options
| Method | Command | How It Works | When to Use |
|---|---|---|---|
| Next-hop IP only | ip route 0.0.0.0 0.0.0.0 192.168.1.1 |
Router performs a recursive lookup: first matches 0.0.0.0/0, then looks up 192.168.1.1 in the routing table to find the outgoing interface | Multi-access networks (Ethernet); when the next-hop IP is on a directly connected subnet |
| Exit interface only | ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/1 |
Router sends all default traffic out the specified interface — no recursive lookup. On Ethernet, router will ARP for every destination (proxy ARP required) | Point-to-point serial links; avoid on Ethernet unless Proxy ARP is enabled |
| Both next-hop + interface (recommended) | ip route 0.0.0.0 0.0.0.0 192.168.1.1 GigabitEthernet0/1 |
No recursive lookup needed — router already knows both the next-hop and the interface. Most efficient forwarding. | Best practice for all environments — prevents recursive lookup overhead and resolves ARP correctly on Ethernet |
IPv6 Default Route
! IPv6 default route — equivalent to 0.0.0.0/0 in IPv4 Router(config)# ipv6 route ::/0 2001:db8::1 ! Via next-hop IPv6 address Router(config)# ipv6 route ::/0 GigabitEthernet0/1 ! Via exit interface Router(config)# ipv6 route ::/0 Gi0/1 2001:db8::1 ! Both (recommended for Ethernet)
Recursive Lookup — Why It Matters
Step 1: Packet destination doesn't match anything → use default route 0.0.0.0/0 Step 2: Default route points to 192.168.1.1 → look up 192.168.1.1 in routing table Step 3: 192.168.1.1 is on connected interface Gi0/1 → forward out Gi0/1With both next-hop and interface specified, Step 2 is skipped — the router already knows the interface at the time the route is installed.
4. Static Default Route — Configuration and Verification
Basic Static Default Route
! Most common — branch router pointing to ISP gateway Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1 ! Verify it appears in the routing table Router# show ip route ! ! Look for the S* entry: 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
Annotated show ip route Output
Router# show ip route
Codes: C - connected, S - static, R - RIP, O - OSPF, D - EIGRP
Gateway of last resort is 203.0.113.1 to network 0.0.0.0
↑ ↑
Next-hop of default route Always 0.0.0.0 for default route
S* 0.0.0.0/0 [1/0] via 203.0.113.1
│ │ │ │ └── Next-hop IP address
│ │ │ └── Metric (0 for static routes)
│ │ └── Administrative Distance (1 = static)
│ └── Destination and prefix length (0.0.0.0 /0 = all addresses)
└── S* = Static route that is also the Gateway of Last Resort
(S without * = static but NOT the gateway of last resort)
5. Dynamic Default Routes — Advertisement via Routing Protocols
In larger networks, manually configuring a default route on every router is impractical. A border or edge router can learn or be given a default route and then advertise it dynamically to all other routers in the domain — they automatically receive a default route without any static configuration.
OSPF — default-information originate
OSPF uses the default-information originate command on the ASBR (AS Boundary
Router) to inject a default route as an External Type 2 LSA (Type 7 in NSSA) into the
OSPF domain. All other OSPF routers receive it as an O*E2 route.
! On the OSPF border router that has internet connectivity: ! Method 1: Only advertise if a default route already exists in the routing table Router(config)# router ospf 1 Router(config-router)# default-information originate ! Method 2: Always advertise default route regardless of local routing table Router(config-router)# default-information originate always ! When to use "always": ! - The border router connects to the ISP via BGP/static and may not have ! a 0.0.0.0/0 in its own routing table (if using a more specific default) ! - Without "always", if the local default route is missing, OSPF stops ! advertising it to other routers — causing them to lose internet access
What Other OSPF Routers See
! On any other router in the OSPF domain: Router# show ip route Gateway of last resort is 10.1.1.1 to network 0.0.0.0 O*E2 0.0.0.0/0 [110/1] via 10.1.1.1, 00:03:15, GigabitEthernet0/0 │ │ │ │ └── OSPF border router IP │ │ │ └── External metric (cost 1 is default for E2) │ │ └── AD 110 / metric 1 │ └── E2 = External Type 2 (metric doesn't increase as it traverses the domain) └── O* = OSPF route that is the Gateway of Last Resort
EIGRP — redistribute static
EIGRP does not have a single command to originate a default route. Instead, you configure a static default route on the border router and redistribute it into EIGRP. Other EIGRP routers receive it as an external EIGRP route (AD 170).
! Step 1: Configure the static default route on the border router Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1 ! Step 2: Redistribute static routes into EIGRP Router(config)# router eigrp 100 Router(config-router)# redistribute static metric 10000 100 255 1 1500 ! └───────────────────────── ! bandwidth delay reliability load MTU (required for EIGRP) ! Alternative — summary address method (cleaner for default only): Router(config)# interface GigabitEthernet0/0 Router(config-if)# ip summary-address eigrp 100 0.0.0.0 0.0.0.0
RIP — default-information originate
! RIP also supports default route advertisement Router(config)# router rip Router(config-router)# default-information originate
BGP — default route to eBGP neighbours
! Advertise a default route to a specific BGP neighbour Router(config)# router bgp 65001 Router(config-router)# neighbor 198.51.100.1 default-originate
6. Default Route in the Routing Decision Process
The default route participates in the normal routing decision process — it simply has the lowest possible specificity, so it is always used last. Understanding how the router selects between multiple routes to the same general destination is essential.
Routing Decision for a Packet to 172.20.15.50:
Router has:
┌─────────────────────────────────────────────────────┐
│ O 172.20.0.0/16 via 10.1.1.1 (AD 110) │
│ O 172.20.15.0/24 via 10.2.2.2 (AD 110) │
│ S* 0.0.0.0/0 via 203.0.113.1 (AD 1) │
└─────────────────────────────────────────────────────┘
Step 1: Find all routes that match 172.20.15.50
→ 172.20.0.0/16 matches (/16 prefix — 16 bits match)
→ 172.20.15.0/24 matches (/24 prefix — 24 bits match)
→ 0.0.0.0/0 matches (/0 — 0 bits match, matches everything)
Step 2: Apply Longest-Prefix Match — most specific wins
→ /24 beats /16 beats /0
→ Winner: 172.20.15.0/24 via 10.2.2.2
Result: Packet forwarded to 10.2.2.2 (NOT to the default route)
Even though the static default (AD 1) has lower AD than OSPF (AD 110),
the more specific /24 wins because of longest-prefix match.
7. Floating Static Default Route (Backup)
A floating static default route is configured with a deliberately high administrative distance — higher than the primary route source — so it only enters the routing table when the primary default route is lost. It "floats" above the primary until needed.
Dual-ISP Scenario
Router connected to two ISPs:
ISP1 (Primary): Connected via OSPF (AD 110) — primary default
ISP2 (Backup): Floating static with AD 115 — activates only if OSPF default lost
┌──────────────────────────────────────────────────────────┐
│ Normal operation: │
│ Routing Table: O*E2 0.0.0.0/0 via ISP1 [110/1] │ ← Active
│ (Floating static suppressed — AD 115 > 110)│ ← Hidden
└──────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────┐
│ ISP1 link fails → OSPF default withdrawn: │
│ Routing Table: S* 0.0.0.0/0 via ISP2 [115/0] │ ← Now active!
└──────────────────────────────────────────────────────────┘
Floating Static Default Route Configuration
! Primary default: OSPF learns it (AD 110) from the border router ! Backup: Static default with AD 115 (higher than OSPF's 110) Router(config)# ip route 0.0.0.0 0.0.0.0 198.51.100.1 115 ! ↑ ↑ ! ISP2 next-hop AD 115 (floating) ! Verify — during normal operation, only OSPF default appears: Router# show ip route Gateway of last resort is 10.1.1.1 to network 0.0.0.0 O*E2 0.0.0.0/0 [110/1] via 10.1.1.1 ! The floating static is in running-config but NOT in routing table ! After ISP1 fails: Router# show ip route Gateway of last resort is 198.51.100.1 to network 0.0.0.0 S* 0.0.0.0/0 [115/0] via 198.51.100.1
See: Administrative Distance | OSPF Overview | Default Route in OSPF Lab
8. Default Route vs. Gateway of Last Resort
These two terms are closely related and frequently confused on the CCNA exam.
| Term | Definition | Where Seen |
|---|---|---|
| Default Route | The routing table entry with destination 0.0.0.0/0 (IPv4) or
::/0 (IPv6) — the actual route configuration |
Appears as S* 0.0.0.0/0 or O*E2 0.0.0.0/0 etc.
in show ip route |
| Gateway of Last Resort | The next-hop IP address to which the router forwards packets when no more specific route exists — derived from the default route's next-hop | Displayed at the top of show ip route output:
"Gateway of last resort is X.X.X.X to network 0.0.0.0" |
Router# show ip route Gateway of last resort is 203.0.113.1 to network 0.0.0.0 ↑ ↑ This line IS the This is the Gateway of Last Resort — the next-hop Gateway of Last IP from the default route entry below Resort display S* 0.0.0.0/0 [1/0] via 203.0.113.1 ↑ This is the default route — the 0.0.0.0/0 entry. The GLoR and the default route next-hop are the same address. If no default route exists, the routing table says: "Gateway of last resort is not set"
0.0.0.0/0 route in the table — the router will drop all packets to
unknown destinations with an ICMP Destination Unreachable message.
9. IPv6 Default Route — ::/0
IPv6 uses the same conceptual default route as IPv4, but the representation is
::/0 — a 128-bit all-zeros prefix with a /0 mask that matches every
IPv6 address.
! Static IPv6 default route via next-hop global unicast address
Router(config)# ipv6 route ::/0 2001:db8:acad::1
! Static IPv6 default route via link-local next-hop (requires interface)
Router(config)# ipv6 route ::/0 GigabitEthernet0/1 fe80::1
! Verify IPv6 default route
Router# show ipv6 route
IPv6 Routing Table - default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
O - OSPF Intra, OE2 - OSPF ext 2
Gateway of last resort is 2001:db8:acad::1
S ::/0 [1/0]
via 2001:db8:acad::1
ipv6 route ::/0 Gi0/1 fe80::1.
10. Verifying and Testing Default Routes
Key Verification Commands
| Command | What It Shows | What to Look For |
|---|---|---|
show ip route |
Full routing table | S* 0.0.0.0/0 entry and "Gateway of last resort is X" |
show ip route 0.0.0.0 |
Detail on the default route entry specifically | Next-hop, AD, metric, age, and which interface it exits |
show running-config | include ip route |
All statically configured routes | Confirms default route exists in config (not just routing table) |
ping 8.8.8.8 |
Tests reachability via default route | Success confirms default route is working end-to-end |
traceroute 8.8.8.8 |
Shows hop-by-hop path used by default route | Confirms correct next-hop is being used; reveals where traffic stops |
show ip cef 0.0.0.0/0 |
CEF entry for the default route | Confirms the FIB (hardware forwarding table) has the default route |
show ip ospf database external |
OSPF external LSAs including default route LSA | Confirms OSPF border router is advertising 0.0.0.0/0 as E2 LSA |
Annotated show ip route 0.0.0.0 Detail
Router# show ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
Known via "ospf 1", distance 110, metric 1, candidate default path
Tag 0, type extern 2, forward metric 20
Last update from 10.1.1.1 on GigabitEthernet0/0, 00:14:22 ago
Routing Descriptor Blocks:
* 10.1.1.1, from 10.1.1.1, 00:14:22 ago, via GigabitEthernet0/0
Route metric is 1, traffic share count is 1
! Breaking it down:
! "Known via ospf 1" → source is OSPF process 1
! "distance 110" → AD is 110 (OSPF)
! "type extern 2" → OSPF External Type 2 (metric doesn't increase across domain)
! "candidate default path" → this IS the default route / Gateway of Last Resort
! "10.1.1.1 via Gi0/0" → next-hop and egress interface
11. Troubleshooting Default Route Issues
| Symptom | Likely Cause | Diagnostic Command & Fix |
|---|---|---|
| No internet access from all hosts | Default route missing from routing table | show ip route — check for S* or O*E2 0.0.0.0/0 entry;
if absent, check routing config and OSPF adjacency |
| "Gateway of last resort is not set" in routing table | No default route configured or the default route's source failed | Configure static default: ip route 0.0.0.0 0.0.0.0 <next-hop>,
or troubleshoot the OSPF/EIGRP session advertising it |
| Default route present but packets still dropped | Next-hop is unreachable (interface down or ARP fails) | ping <next-hop-IP> — verify next-hop reachable;
show ip interface brief to check interface status;
show arp for next-hop ARP entry |
| Default route not being advertised by OSPF to other routers | default-information originate not configured, or border router
has no default route and "always" keyword was omitted |
show ip ospf database external — check for 0.0.0.0 LSA;
add default-information originate always if needed |
| Traffic uses wrong default route (primary should be OSPF but static is winning) | Static default (AD 1) overriding the OSPF default (AD 110) | show ip route 0.0.0.0 — check AD; the static (AD 1) always beats
OSPF (AD 110); either remove the static or set its AD higher than 110 |
| Floating static not activating after primary fails | Floating static AD not higher than primary protocol's AD; primary route still present from another source | Verify floating static AD > primary protocol AD; confirm primary route is
truly gone with show ip route 0.0.0.0 |
| Routing loop with default route | Two routers each have a default route pointing to each other | traceroute 8.8.8.8 — shows packets bouncing between two hops
until TTL expires; check default route next-hops on both routers |
12. Default Route in Different Network Environments
| Environment | Default Route Approach | Typical Configuration |
|---|---|---|
| SOHO / Small Branch | Single static default route to the ISP or HQ gateway | ip route 0.0.0.0 0.0.0.0 <ISP-gateway> |
| Multi-site Enterprise | OSPF advertises default from border router; all internal routers learn it dynamically | Border: default-information originate; branches: receive
O*E2 0.0.0.0/0 automatically |
| Dual-ISP redundancy | Primary dynamic (or static AD 1) + floating static backup with higher AD | Primary: ip route 0.0.0.0 0.0.0.0 ISP1;
Backup: ip route 0.0.0.0 0.0.0.0 ISP2 5 |
| Internet edge (BGP) | BGP peers exchange full routing table or default-only; default-originate to customers | neighbor <IP> default-originate |
| Stub EIGRP network | Default route redistributed into EIGRP from border router | redistribute static metric ... + local static default |
13. Common Misconceptions About Default Routes
-
"The default route always wins because everything matches it."
Completely wrong. The default route has the least specificity (/0) and always loses to any more specific route due to longest-prefix match. It is the absolute last resort — only used when no other route matches. -
"S* means the static route is the best possible route."
The asterisk (*) means it is the Gateway of Last Resort — the route used for packets with no other match. It does not mean this route is preferred over more specific routes; any /1 through /32 prefix will beat it for its respective destinations. -
"default-information originate advertises all routes to neighbours."
It only advertises the0.0.0.0/0default route as an OSPF External Type 2 LSA. It does not redistribute any other routes — for that, you need theredistributecommand. -
"If the interface goes down, the static default route is automatically removed."
Not always. A static route configured with a next-hop IP (not an interface) remains in the routing table even if the path to that next-hop fails — the route stays but traffic blackholes. A route configured via exit interface is removed when the interface goes down. This is why monitoring next-hop reachability (via IP SLA) is important for static default routes. -
"Every router needs a default route."
Core routers in a full-mesh, fully-learned BGP environment do not need default routes — they have specific routes for every destination. Default routes are appropriate for stub routers and edge devices that don't need a full routing table.
14. Key Points & Exam Tips
- Default route = 0.0.0.0/0 (IPv4) or ::/0 (IPv6) — matches everything with zero bits; always loses to more specific routes (longest-prefix match).
- Command:
ip route 0.0.0.0 0.0.0.0 <next-hop>— default AD is 1 (static). - Specify both next-hop and exit interface to prevent recursive lookups on
Ethernet — e.g.,
ip route 0.0.0.0 0.0.0.0 192.168.1.1 Gi0/1. S*in the routing table = static default route that is the Gateway of Last Resort.O*E2= OSPF-learned default.- OSPF:
default-information originateinjects default as E2 LSA. Addalwaysto advertise even without a local default route. - EIGRP:
redistribute static(requires a static default route configured locally first). - Floating static backup: Set AD one higher than primary protocol. Behind OSPF (110) use AD 111+; behind EIGRP internal (90) use 91+.
- Gateway of Last Resort = the next-hop shown at the top of
show ip routeoutput — derived from the default route entry. - If
show ip routesays "Gateway of last resort is not set," no default route is installed — packets to unknown destinations are dropped. - A static default configured with only a next-hop IP stays in the routing table even if the next-hop is unreachable — traffic may blackhole silently.
Related pages: Static Route Configuration | Administrative Distance | show ip route | OSPF Overview | EIGRP Overview | RIP Concepts | BGP Overview | IPv6 | Static Routing Configuration | Default Route in OSPF | OSPF Single-Area Lab | EIGRP Configuration Lab | Troubleshooting Layer 3 Routing