Network Bytes · Episode 80 · CCNA 3.3
"Floating static routes"
A floating static route is a backup static route with a higher administrative distance than the route it backs up. It stays out of the routing table until the main route disappears, then takes over, and steps back when the main route returns.
The understudy idea
In a play, the star goes on stage and the understudy waits backstage, ready if the star cannot perform. A router can work the same way with two links to the internet: a main link it uses every day and a backup link that should only carry traffic when the main one fails. The trick that makes the backup wait is a number called administrative distance.
Lowest distance wins the stage
When a router knows more than one way to reach the same network from different sources, it compares their administrative distance (AD), a trust score from 0 to 255. Lower wins. Default values on Cisco routers: directly connected 0, static 1, OSPF 110. So a normal static route for the main link has AD 1, and it goes into the routing table, the list of routes the router actually uses to forward packets.
Making a static route float
A static route lets you set your own distance: it is the last number in the command.
`` ip route 0.0.0.0 0.0.0.0 203.0.113.9 5 ``
This is a default route (0.0.0.0 0.0.0.0 means "everything") through next hop 203.0.113.9, with distance 5. Because 5 is higher than the main route's 1, it loses the comparison and stays out of the routing table. It is still in the configuration, waiting. That is a floating static route: it "floats" above the table until it is needed.
Failover and failback
If the main link goes down, its route is removed from the routing table. Now the backup has no competition, so it drops into the table and traffic starts using the backup link, with nobody typing a command. When the main link comes back, its AD 1 route returns, beats the backup again, and the floating route steps back out of the table.
Try it yourself
In Cisco Packet Tracer (free with a Cisco Networking Academy account), connect one router to two others over two links. On the first router add a normal default route through one link and a second default route through the other link with distance 10. Run show ip route and notice that only one default route is listed. Shut down the main interface, run show ip route again, and watch the backup appear. Bring the interface back up with no shutdown and check once more.
Good to know
- A floating static route is a static route configured with an administrative distance higher than the route it backs up, so it stays out of the routing table until the preferred route is removed.
- Default AD values: connected 0, static 1, OSPF 110. Lower is preferred.
- On Cisco IOS the distance is the last number in
ip route <prefix> <mask> <next hop> <distance>. - Caveat: a static route through a next-hop address is only removed when the router can no longer reach that next hop (usually when the exit interface goes down). If the link stays up but the far side fails, the main route can stay in the table. That is why IP SLA tracking exists, which is beyond this episode.
203.0.113.9is a documentation address (RFC 5737), safe to use in examples.- Administrative distance is covered in EP44 and static routes in EP45.
For CCNA learners
CCNA exam topic 3.3 (configure and verify IPv4 and IPv6 static routing) lists floating static routes alongside default, network and host routes. Know that the distance is the last value in ip route, that it must be higher than the AD of the route it backs up, and that show ip route shows only the winning route.
Answer to the comment question
No, it would not stay backstage. Lower administrative distance wins, and 5 is lower than OSPF's 110. So the "backup" static route would beat the OSPF route, go into the routing table, and be used all the time instead of OSPF. To float behind an OSPF route, the static route needs a distance above 110, for example 111 or higher.
Test your knowledge
Quick quiz: "Floating static routes"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- Cisco, "Configure a Next Hop IP Address for Static Routes": floating static route example with a higher distance, installed only when the preferred route disappears
- Cisco, "What Is Administrative Distance?": default distances (connected 0, static 1, OSPF 110); lower is preferred
- Cisco, "CCNA 200-301 v1.1 exam topics": 3.3 configure and verify IPv4 and IPv6 static routing (default, network, host and floating static routes)
- IETF, "RFC 5737, IPv4 Address Blocks Reserved for Documentation": 203.0.113.0/24 used in the example
Video transcript
How does a router switch to a backup link all by itself?
Think of a play with an understudy. The star goes on stage. The understudy waits backstage.
Your main link is the star: a static route with an administrative distance of one. Lowest distance wins the stage.
Add a backup static route with a higher distance, like five. It loses, so it waits backstage, out of the routing table. That's a floating static route.
If the main link goes down, its route leaves the table, and the backup steps on stage. When the main link returns, it takes the stage back.
Your main route is from OSPF, distance one hundred ten. Will a backup static route with distance five stay backstage? Comment your answer below!
That's your byte.
More from Network Bytes
- EP78"Virtual machines and hypervisors"
- EP79"On-premises vs cloud"
- EP81"TFTP and FTP: backing up configs"
- EP82"Inter-VLAN routing: router on a stick"