PracticeLabs
Week 4Lesson 4Required27 min estimated0% progress

Default Routes and Floating Static Routes

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.

Lesson orientation

What you'll learn (4 objectives)~27 min: video → lesson → check → apply → lab prep

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 before and after the primary fails
  • Verify both with show ip route and confirm the S* candidate-default marker

Terms you will see

Default route0.0.0.0/0Gateway of last resortCandidate default (S*)Administrative distanceFloating static routeEqual-cost load sharing

Time breakdown

  • Read the notes13 min
  • Static Routing Labs — failover8 min
  • Selection practice6 min

Assigned video

Opens on YouTube
Optional video

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

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~6 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • The higher-AD backup staying out of the table while the primary is up
  • The backup installing and carrying traffic the moment the primary fails

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

A default route is a static route to everywhere else

Instead of a specific prefix, a default route uses the all-zeros network and all-zeros mask: ip route 0.0.0.0 0.0.0.0 203.0.113.1. The prefix 0.0.0.0/0 matches every IPv4 destination, because a zero-length prefix imposes no constraint at all. 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. It is how a stub site or a home router reaches the whole Internet with one line instead of thousands.

The critical word is last
Route selection uses longest-prefix match, and 0.0.0.0/0 is the shortest possible prefix, so it loses to any route with more matching bits. If a router has both a default and a specific 8.8.8.0/24, a packet for 8.8.8.8 takes the /24 — twenty-four matching bits beat zero. A default route never overrides your other routes; it sits quietly underneath them as the fallback. Lesson 5 formalises exactly why.
How a default route appears
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 asterisk beside the S flags it as a candidate default — the route feeding that gateway-of-last-resort banner. If traffic to unknown destinations is being dropped, the first thing to check is whether that banner line is present at all. Its absence means no default route is installed, whatever the configuration says.

A floating static route waits in reserve

Administrative distance is how a router ranks route sources offering the same prefix: lower AD is more trusted, and only the winner is installed. A normal static route has AD 1. If you configure a second static route to the same destination but append a larger AD, IOS holds it back — a floating static route.

Primary and floating backup to the same prefix
! 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, absent from 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 is installed. The AD 5 route is not merely marked inactive — it is not visible in show ip route at all, because a less-trusted route for a prefix that already has a winner is held out of the table entirely. The instant the primary leaves the table, whether the interface fails, the next hop becomes unreachable, or a protocol withdraws it, the floating route becomes the best remaining source and IOS installs it. Traffic fails over with no manual change. When the primary returns it reclaims the prefix, and the floating route goes dark again.

Same AD is not a backup
With equal AD — and, from the same source, equal metric — IOS treats the two routes as equal-cost and installs both, load-sharing across them. That is sometimes what you want, but it is not a floating static: there is no primary, no backup, and no clean failover. The reserve route must carry a strictly higher AD to be suppressed until the primary is gone.

The number you choose only has to be higher than the primary's AD and lower than any source you would rather not lose to. A floating static backing up another static (AD 1) commonly uses something small like 5. A floating static backing up OSPF, which is AD 110, would need a value above 110 to stay dormant while OSPF is healthy. Note also that a floating static is not load balancing: exactly one path is used at a time.

A failover you can watch

Configure the default, the primary, and the floating backup
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
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 its banner. The primary shows via 10.1.2.2. 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 and look again.

Kill the primary next hop, then re-check
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 has installed — note distance 5 — and forwarding continues via 10.1.5.2 without anyone touching the configuration. Bring Gi0/1 back up and the AD 1 primary reclaims the prefix, pushing the floating route back into reserve.

Troubleshooting — the backup route is missing
Symptom: an engineer configures a floating static, checks show ip route, cannot find it, and concludes the command did not take. Diagnosis: this is the feature working correctly. A floating static is deliberately invisible while the primary owns the prefix, because a less-trusted route for an already-won prefix is held out of the RIB. Fix: do not re-enter or 'correct' the route. Verify it by failing the primary — shut the primary's exit interface — and confirm the higher-AD route appears with its distance shown. Then restore the primary and confirm it reclaims the prefix.

What you should retain

  • A default route is ip route 0.0.0.0 0.0.0.0 <next-hop>; it catches every unmatched destination and shows as S* with a gateway-of-last-resort line.
  • Being the least specific prefix, the default always loses to a more specific route — it is a fallback, never an override.
  • A floating static is an ordinary static route given a higher AD so it stays out of the table until the primary is gone.
  • Failover and recovery are automatic in both directions, with no configuration change.
  • Equal AD installs both routes as equal-cost load sharing, which is not a backup relationship.
  • Choose an AD above the primary's and below any source you want to keep losing to.
Pause and predictNot scored — nothing is recorded

Before you read on

R1 has three routes: ip route 10.1.4.0 255.255.255.0 10.1.2.2 (AD 1), ip route 10.1.4.0 255.255.255.0 10.1.5.2 5 (AD 5), and ip route 0.0.0.0 0.0.0.0 203.0.113.1. (1) While everything is up, which routes to 10.1.4.0/24 appear, 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 is installed? (3) Which entry carries a packet to 172.20.9.9?

Interactive tool
Required~8 min

Static Routing Labs

Configure a primary and a floating static to the same prefix, then drop the primary link and confirm the AD 5 route installs. Watching the table change on failover is the fastest way to believe that an invisible route is really there.

Section quiz

Check this section before moving on

Required8 questions~10 min

Static Routing & Failover

The quiz opens on its own page so you can focus on it. It is a Week 1 milestone, tracked separately from this lesson's own completion.

Topics covered

  • The three forms of ip route and when each is appropriate
  • Recursive lookup and the dependency it creates
  • Routes needed at every router, in both directions
  • Default routes, floating statics, and administrative distance
Start the quiz

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

Routing Protocols

For the default route as candidate default, and how AD is used across the protocols you meet in Week 5