Default and floating static routes
Default routes and the gateway of last resort, host routes, and floating statics that appear only when the primary route fails.
Default routes and gateway of last resort
A default route 0.0.0.0/0 matches every destination that no more-specific route covers — the 'send it somewhere sensible' instruction. In the table it appears as the gateway of last resort (S* 0.0.0.0/0). IPv6 uses ::/0.
Send all unmatched traffic to the ISP at 203.0.113.1 — Privileged EXEC → Global configuration
Cisco IOS / IOS XE
configure terminal ip route 0.0.0.0 0.0.0.0 203.0.113.1 ipv6 route ::/0 2001:db8:ffff::1 end
show ip route show ipv6 route
- 'Gateway of last resort is 203.0.113.1 to network 0.0.0.0' appears.
- S* route marks the default candidate.
Changes device configuration.
Gateway of last resort is 203.0.113.1 to network 0.0.0.0Router's chosen default.S* 0.0.0.0/0 [1/0] via 203.0.113.1The static that provides it — the asterisk marks the default candidate.Floating statics
A floating static is a normal static route given an AD higher than the dynamic protocol's so it stays out of the table while the primary route exists. ip route 10.0.0.0 255.0.0.0 10.9.9.2 150 installs only if the better source (say OSPF at 110, or another static at 1) withdraws its /8 — an elegant failover without protocols.
Choosing a floating AD
| Primary source | Primary AD | Floating AD should be | Example |
|---|---|---|---|
| Static | 1 | Any usable value 2–254 (255 marks unreachable) | ip route ... <nh> 10 |
| EIGRP internal | 90 | 91+ | ip route ... <nh> 95 |
| OSPF | 110 | 111+ | ip route ... <nh> 130 |
| RIP | 120 | 121+ | ip route ... <nh> 150 |
The floating route must match the SAME prefix as the primary — AD compares identical prefixes only.
- Primary
- OSPF-learned 10.0.0.0/8 via Gi0/1
- Backup
- Static 10.0.0.0/8 via Gi0/2, AD 150
- Normal state:
show ip route 10.0.0.0shows the OSPF route — AD 110 beats 150. - Kill the OSPF path: the /8 disappears → the floating static installs.
- Restore OSPF: the dynamic route returns and re-wins.
Failover is automatic both directions — the higher-AD route never fights for the table.
Verification
Common mistakes
- Using a different prefix length for the floating static — a /8 floating static does not back up a /24 primary.
- Setting floating AD below the primary's AD — it then shadows the good route permanently.
- Believing the floating route 'monitors' anything — it installs only when the identical prefix withdraws.
- Expecting the default route to handle a specific destination that has a route — LPM always prefers the specific match.
Observation: Primary OSPF path fails; traffic still doesn't use the backup static.
- Floating static's AD is lower than OSPF's — it would have always won instead
- Backup next hop unreachable
- Different prefix length between primary and backup
| Check | Indicates |
|---|---|
show running-config | include ip route | Reveals both the floating AD and prefix — compare to the withdrawn route. |
show ip route during the outage | Confirms whether the floating route installed at all. |
| Ping the backup next hop | An unreachable backup can't install a route. |
Correction: Correct the floating AD/prefix or restore backup path reachability.
During primary failure the static installs and traffic reroutes; on recovery it withdraws.
Related resources
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- Cisco — IP Addressing Services Command Reference — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.