PracticeLabs
Week 4IP Connectivity27 min

Default Routes and Floating Static Routes

Learning objectives

  • Configure a default route (0.0.0.0/0) and explain when a router uses the gateway of last resort
  • Explain how a floating static route uses a higher administrative distance to act as a backup path
  • Predict which of a primary and a floating static route is installed while the primary is up and after it fails
  • Verify a default and a floating static route with show ip route and confirm the S* candidate default marker
Mission

Configure a default route as the gateway of last resort and a floating static route that stays dark until the primary path fails, using administrative distance.

Week 4 · Lesson 4 · Active ~27 min · Optional video ~6 min · Practice ~12 min · Domain: IP Connectivity

You should be able to configure a next-hop static route and know that static routes carry administrative distance 1 by default.

Prerequisites: static-routes-ipv4

Baseline check

R1 has specific routes to its internal subnets and one link to the Internet via 203.0.113.1. Before reading on: what single route lets R1 forward traffic for any destination it has no specific route for — and if R1 also had a specific route to 8.8.8.0/24, which route would win for 8.8.8.8?

Hold both answers. The second one is longest-prefix match in disguise, and it is the key to understanding why a default route never "takes over."

A default route is a static route to "everywhere else." Instead of a specific prefix, it uses the all-zeros network and all-zeros mask:

ip route 0.0.0.0 0.0.0.0 203.0.113.1

0.0.0.0/0 matches every IPv4 destination, because a zero-length prefix imposes no constraint. That makes it the ultimate catch-all: a router with this route can forward a packet for any destination it has no more specific entry for, sending it to the gateway of last resort — here the ISP at 203.0.113.1. This is exactly how a stub site or a home router reaches the whole Internet with one line instead of thousands of specific routes.

The critical word is last. Because route selection uses longest-prefix match, 0.0.0.0/0 — the shortest possible prefix — loses to any route with more matching bits. If R1 has both S* 0.0.0.0/0 and S 8.8.8.0/24, then a packet for 8.8.8.8 takes the /24 (24 matching bits beat 0). The default only wins for destinations that match nothing more specific. So a default route never overrides your other routes; it quietly sits underneath them as the fallback. That answers the baseline: the specific 8.8.8.0/24 wins for 8.8.8.8.

In the table, a default route appears with a distinctive marker:

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

The * next to S flags it as a candidate default — the route feeding the "gateway of last resort" line. If you ever see traffic to unknown destinations being dropped, the first thing to check is whether that gateway-of-last-resort line is present at all.

Default route as candidate default (topic guide)

A floating static route is an ordinary static route wearing a higher administrative distance so it stays out of the table until it is needed. Administrative distance (AD) is how a router ranks route sources offering the same prefix: lower AD is more trusted, and only the winner is installed into the routing table. A normal static route has AD 1. If you configure a second static route to the same destination but append a larger AD number, IOS keeps it in reserve:

! Primary path (default AD 1) — installed and forwarding
ip route 10.1.4.0 255.255.255.0 10.1.2.2

! Floating backup (AD 5) — held in reserve, not in the table while the primary is up
ip route 10.1.4.0 255.255.255.0 10.1.5.2 5

While the primary is up, only the AD 1 route via 10.1.2.2 is installed — the AD 5 route is not even visible in show ip route, because a less-trusted route for a prefix that already has a winner is held back. The instant the primary route leaves the table — the interface fails, the next hop becomes unreachable, or a dynamic protocol withdraws it — the floating route is the next-best source, so IOS installs it and traffic fails over to 10.1.5.2 automatically. When the primary returns, it reclaims the slot (AD 1 beats AD 5) and the floating route goes dark again.

The number you pick just has to be higher than the primary's AD and lower than any source you want to lose to. A floating static backing up a primary static (AD 1) commonly uses something small like 5. A floating static backing up OSPF (AD 110) would need an AD above 110 to stay dormant while OSPF is healthy. Two things a floating static is not: it is not load balancing (only one path is used at a time), and a second route does not become a backup just by existing — it must carry a higher AD, or both routes install as equal-cost paths.

What happens if I give the backup the same AD as the primary?

With equal AD (and, for the same source, equal metric), IOS treats the two routes as equal-cost and installs both, load-sharing traffic across them. That is sometimes desirable, but it is not a floating static — there is no primary/backup relationship and no clean failover. To get true backup behavior, the reserve route must have a strictly higher AD so it is suppressed until the primary is gone.

Free CCNA | Floating Static Routes | Day 24 Lab | CCNA 200-301 Complete Course

~6 min

Watch the higher-AD backup route stay out of the table while the primary is up, then install and carry traffic the moment the primary path fails.

Optional. Skip if the written failover walkthrough and the practice table already made the AD comparison clear.

Watch on YouTube

Enrichment only — the configuration walkthrough below is the primary path.

Default route, floating backup, and a failover you can see

! A default route to the ISP — the gateway of last resort
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1

! Primary static to a remote subnet (AD 1) and a floating backup (AD 5)
R1(config)# ip route 10.1.4.0 255.255.255.0 10.1.2.2
R1(config)# ip route 10.1.4.0 255.255.255.0 10.1.5.2 5
R1(config)# end

R1# show ip route static
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
      10.0.0.0/8 is variably subnetted, ...
S        10.1.4.0/24 [1/0] via 10.1.2.2

Note what is present and what is absent: the default shows as S* with the gateway-of-last-resort banner, the primary shows as S ... [1/0] via 10.1.2.2, and the floating backup does not appear at all — AD 5 is suppressed while the AD 1 primary owns the prefix. Now fail the primary path:

R1(config)# interface GigabitEthernet0/1
R1(config-if)# shutdown          ! kills the primary next hop 10.1.2.2
R1(config-if)# end

R1# show ip route 10.1.4.7
Routing entry for 10.1.4.0/24
  Known via "static", distance 5, metric 0
  Routing Descriptor Blocks:
  * 10.1.5.2
      Route metric is 0, traffic share count is 1

The primary is gone, so the floating route (distance 5) has installed via 10.1.5.2 and forwarding continues without any manual change. Bring Gi0/1 back up and the AD 1 primary reclaims the prefix, pushing the floating route back into reserve.

Reproduce the failover in the Static Routing Labs tool — it lets you drop the primary link and watch the higher-AD route take over.

Configure a primary and a floating static to the same prefix, then fail the primary and confirm the AD 5 route installs.

Open static-routing

R1 has all three of these to reach 10.1.4.0/24, plus a default route. Predict the table before revealing.

RouteAD
ip route 10.1.4.0 255.255.255.0 10.1.2.21
ip route 10.1.4.0 255.255.255.0 10.1.5.2 55
ip route 0.0.0.0 0.0.0.0 203.0.113.11

Pause and predict

  1. While everything is up, which route(s) to 10.1.4.0/24 appear in show ip route, and which next hop forwards a packet to 10.1.4.7?
  2. Gi0/1 (the path to 10.1.2.2) goes down. Now which route to 10.1.4.0/24 is installed?
  3. For a packet to 172.20.9.9 (no specific route), which entry is used?
Reveal answer
  1. Only the AD 1 route via 10.1.2.2 is installed for 10.1.4.0/24; the AD 5 floating route is suppressed and does not show. A packet to 10.1.4.7 forwards via 10.1.2.2.
  2. With the primary's next hop unreachable, IOS installs the floating route via 10.1.5.2 (AD 5); traffic to 10.1.4.7 fails over to it automatically.
  3. 172.20.9.9 matches no specific prefix, so the default route S* 0.0.0.0/0 via 203.0.113.1 wins by being the only match — the gateway of last resort. It never competes with the 10.1.4.0/24 routes because longest-prefix match always prefers the /24 for those destinations.

Quick check (3 items) · retrieve

Answer from memory:

  1. Write a default route to 203.0.113.1 and state exactly when the router uses it.
  2. What makes a static route "floating," and why is it absent from show ip route while the primary is healthy?
  3. You want a backup path but instead both routes install and load-share. What did you get wrong?
Open quiz

Review sheet

  • Default route: ip route 0.0.0.0 0.0.0.0 <next-hop> — catches every unmatched destination; shows as S* with a gateway-of-last-resort line.
  • Least specific: longest-prefix match means any specific route beats the default; the default is a fallback, never an override.
  • Floating static: a normal static route given a higher AD so it stays out of the table until the primary route is gone.
  • Automatic failover: when the primary leaves the RIB, the floating route installs; when the primary returns, it reclaims the prefix.
  • Same AD ≠ backup: equal AD installs both routes as equal-cost load sharing, not primary/backup.
Exam trap
The floating static route is intentionally invisible in show ip route while the primary is up. Do not "fix" a missing backup route that is actually working correctly — confirm by failing the primary and watching the higher-AD route appear.

You have seen AD pick a backup and LPM pick the default; next formalize the full order the router uses to choose among all competing routes.

Next: Longest-Prefix Match, Administrative Distance, and Metrics