Static, default and floating static routes: configuration, tracking and pitfalls
In short: Static routes are typed in by hand and never change on their own. A default route sends everything without a better match towards one gateway. A floating static route is a backup with a higher administrative distance, and IP SLA tracking lets a static route be withdrawn when the path behind it fails.
When static routing makes sense
Static routes are simple, predictable and use no CPU or bandwidth for routing updates. They suit small sites with one way out, stub networks, default routes to an ISP, and specific overrides. They do not react to failures by themselves and become painful to maintain at scale, which is where dynamic protocols such as OSPF take over.
Configuring static routes
! Next-hop form: reach 192.168.20.0/24 via 10.0.0.2
ip route 192.168.20.0 255.255.255.0 10.0.0.2
! Fully specified: exit interface and next hop
ip route 192.168.30.0 255.255.255.0 GigabitEthernet0/1 10.0.1.2
! Default route to the ISP
ip route 0.0.0.0 0.0.0.0 203.0.113.1
! IPv6 equivalents
ipv6 unicast-routing
ipv6 route 2001:db8:20::/64 2001:db8:ffff::2
ipv6 route ::/0 2001:db8:ffff::1
The next-hop form is the usual choice. The router finds which interface reaches the next hop through a second (recursive) lookup. Using only an exit interface is fine on point-to-point links, but on Ethernet it makes the router ARP for every destination and rely on proxy ARP, so avoid it. The fully specified form removes any doubt and is preferred for IPv6 link-local next hops.
Remember that routing works in both directions: the far router needs a route back to your networks too. Missing return routes are the most common static-routing mistake.
Default routes and the default gateway
A default route (0.0.0.0/0 or ::/0) matches every destination, but because it has the shortest possible prefix it is only used when nothing more specific exists. Hosts have the same idea in the form of a default gateway. On a Layer 2 switch that does not route, you set ip default-gateway so it can be managed from other subnets; once ip routing is enabled, use a default route instead.
Floating static routes and tracking
Add a number after the next hop to set the administrative distance. A backup default route with AD 250 stays hidden while the primary (AD 1) exists, and is installed automatically if the primary leaves the routing table.
ip route 0.0.0.0 0.0.0.0 203.0.113.1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 250
There is a catch: a static route only disappears when its next hop becomes unreachable, typically when the local interface goes down. If the fibre stays up but the ISP fails further upstream, the primary route stays and traffic is lost. IP SLA tracking fixes this by pinging something beyond the link and removing the route when the pings fail.
ip sla 1
icmp-echo 203.0.113.1 source-interface GigabitEthernet0/0
frequency 10
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 reachability
ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 250
A floating route also works as a backup for a dynamic protocol: give it an AD above the protocol's (for example 120 behind EIGRP's 90 or OSPF's 110).
Real-world example: a retail branch had a fibre primary and a 4G backup with a floating default. When the ISP had a core outage the fibre link stayed up, so the router never failed over and tills went offline for two hours. Adding an IP SLA probe to a public address beyond the ISP made the next outage switch to 4G within 30 seconds.
Tip: when you summarise routes towards other routers, add a static route for the summary to Null0 so that packets for unused parts of the range are dropped instead of following the default route back out and looping.
Common mistakes: typing the wrong mask (255.255.0.0 instead of 255.255.255.0) so the route covers far more than intended; pointing a route at a next hop that is not on a directly connected subnet; forgetting the return route on the far router; and leaving old test routes in place. Review static routes during every change and remove any you cannot explain.
Practice
Write a default route pointing at 192.0.2.1.
ip route 0.0.0.0 0.0.0.0 192.0.2.1A backup static route has AD 5 and OSPF provides the primary route. Which is used?
Why is IP SLA tracking needed with a floating static route?
Key takeaways
- Static routes are predictable and lightweight but do not adapt by themselves.
- Prefer the next-hop or fully specified form; avoid exit-interface-only routes on Ethernet.
- A default route matches everything but is used only when nothing more specific exists.
- A floating static route has a higher AD and appears only when the primary disappears.
- Use IP SLA tracking so a route is withdrawn when the path behind it fails.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.