Sub topic 3
Floating Static Routes as Backup Paths
Assume you know IPv4 addressing, CIDR notation, routers, and basic router or Linux commands. A routing table can contain several possible paths to the same destination. The router first prefers the route source with the lowest administrative distance, then uses the protocol’s metric when comparing routes from that source.
Floating static routes as backup paths
A floating static route is a static route with a higher administrative distance than the primary dynamic route. It remains inactive while the primary route exists. If the primary route disappears, the static route enters the routing table.
! OSPF primary route has the default administrative distance of 110
router ospf 1
router-id 1.1.1.1
network 10.1.0.0 0.0.255.255 area 0
! Backup route has distance 200, so it floats below OSPF
ip route 10.2.0.0 255.255.0.0 192.168.2.2 200The route may still fail if the next hop is unreachable. Use tracking or object tracking when the platform must test more than the directly connected next hop.
Interior and exterior routing
An interior gateway protocol (IGP) exchanges routes inside one administrative network, called an autonomous system. RIP is distance-vector based, while OSPF is link-state based. An exterior gateway protocol (EGP) exchanges routes between autonomous systems. BGP is the practical path-vector protocol for this purpose.
Choosing an approach
Use static routing for small, stable networks, stub networks, or tightly controlled backup paths. Use dynamic routing when links change, many routes exist, or fast recovery matters. Most production networks combine both.
Verifying and troubleshooting routes
Check the installed route, its source, and the selected next hop:
show ip route
show ip route static
show ip route ospf
show ip route 10.2.5.7If the expected route is missing, check the next-hop reachability, prefix and mask, administrative distance, interface status, and protocol neighbors. show ip protocols can reveal whether a protocol is advertising the expected network.
Redistributing routes between sources
Route redistribution imports routes learned from one source into another protocol, such as importing static routes into OSPF. It requires careful filtering and often route tags. Uncontrolled redistribution can create loops, duplicate paths, or oversized routing tables.
Exercise
OSPF learns 10.2.0.0/16 with distance 110. What distance should a backup static route use?
Show answer
A value greater than 110, such as 200, so OSPF remains preferred while it is available.