Course contents

Chapter 8: RoutingLesson 5 of 16

Default routes

One route that catches everything else: the usual way to send traffic to the internet.

Beginner · 6 min read

Technical definition

Default route is the route to 0.0.0.0/0 (or ::/0 in IPv6), which matches every destination address. Because its prefix length is zero, the router uses it only when no more specific route matches; its next hop is called the gateway of last resort.

A website R1 has no route to

PC1 can reach the branch server, but R1 has no specific route to the example website at 198.51.100.80. A default route supplies a fallback next hop without listing every remote network.

What a default route is

Diagram
The default is a fallback, not an override
The default is a fallback, not an override
The default is a fallback, not an overrideR1 has a static route to 192.168.3.0/24 via R2 10.0.12.2 and a default route via ISP 203.0.113.1. A packet for 192.168.3.10 uses /24. A packet for 198.51.100.80, with no other matching route in this example, uses /0. Without either match it is dropped.R1Destination 192.168.3.10Matches 192.168.3.0/24 and /0Choose /24 → 10.0.12.2 (R2)Destination 198.51.100.80Only 0.0.0.0/0 matches hereChoose /0 → 203.0.113.1 (ISP)
Routes are assumed installed and next hops usable. A default route alone does not establish NAT, upstream policy, application availability or the return path.
Diagram
Default routes on R1 and R3
Default routes on R1 and R3
192.168.1.0/24203.0.113.0/3010.0.12.0/3010.0.23.0/30192.168.2.0/24192.168.3.0/24PC1IP 192.168.1.10ISPIP 203.0.113.1R1R2R3PC2IP 192.168.2.10ServerIP 192.168.3.10

Device key: PC1, PC2 (computer) · ISP (network / service) · R1, R2, R3 (router)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • PC1: IP 192.168.1.10
  • ISP: IP 203.0.113.1
  • PC2: IP 192.168.2.10
  • Server: IP 192.168.3.10
  1. 1. R1: no specific route matches, so the default route sends the packet to the ISP at 203.0.113.1.
  2. 2. R3 is a stub: it has only one way out, through R2. One default route via 10.0.23.1 replaces every other route it would need.
  3. 3. R2 passes it on: with its own default route via 10.0.12.1, internet traffic from the branches reaches R1 and then the ISP.

Why a stub router needs only one route

A stub network is a network with only one way in and out, like a branch office with one link to head office. For a stub, every remote network is reached the same way. Listing them one by one adds work and gains nothing, so a single default route is the cleanest design.

Diagram
Why a stub router needs only one route
Why a stub router needs only one route
RouterIts positionRoutes it needs
R1Edge, toward the internetSpecific routes to the company LANs + default to the ISP
R2MiddleSpecific routes both ways + default toward R1
R3Stub (one exit)Only a default toward R2
Read each row across: the left box names the item, the others describe it.

PC1 uses a private address (192.168.1.10). The internet can't route back to private addresses, so R1 must also translate it to its public address, 203.0.113.2. That job is called NAT. The default route selects an outbound next hop. Internet access also needs suitable translation, upstream routing, return routes and permitting policy.

One line on each router

Based on Cisco IOS / IOS XE documentation, not run on a lab device.

ip route 0.0.0.0 0.0.0.0 203.0.113.1

On R1: everything not listed elsewhere goes to the ISP.

ip route 0.0.0.0 0.0.0.0 10.0.12.1

On R2: unknown destinations go toward R1.

ip route 0.0.0.0 0.0.0.0 10.0.23.1

On R3: the only route this stub router needs besides its connected networks.

Spotting the gateway of last resort

This output is based on Cisco documentation, not run on a lab device.

Example output · based on Cisco documentation; exact format varies by platform and software version
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       * - candidate default, U - per-user static route
       ...

Gateway of last resort is 10.0.23.1 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.0.23.1
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.23.0/30 is directly connected, GigabitEthernet0/0
L        10.0.23.2/32 is directly connected, GigabitEthernet0/0
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, GigabitEthernet0/1
L        192.168.3.1/32 is directly connected, GigabitEthernet0/1
S* marks the static default, and the "Gateway of last resort" line confirms it is in use. Without a default the line reads "Gateway of last resort is not set".

In practice, when a branch can reach head office but not the internet, that "Gateway of last resort" line is the first thing worth reading on each router along the way. One router without a default is enough to drop the traffic.

Test yourself on default routes

Predict · scenario 1

R1 has 192.168.3.0/24 via R2 and 0.0.0.0/0 via the ISP. Which route does a packet to 192.168.3.10 use?

Predict · scenario 2

Why is a single default route enough on R3?

Cisco reference: Route installation, administrative distance and forwarding.