Floating Static Route
Course Contents
1. Introduction to Floating Static Route
Floating Static Route is a route with a Higher Administrative Distance than the primary route. This route acts as a backup route in case the primary route is down.
Let’s look at the example below. Here you can see a network topology with R1, R2, and R3.

In this topology, R1 wants to reach the 192.168.3.0/24 network. It can use 2 paths: the primary route is through R2 by using OSPF with an administrative distance of 110, and the backup path is by using a Floating Static route with an Administrative Distance of 130.
Primary Route with OSPF
If we think about how R1 will decide to install these paths in its routing table, the route with the lowest administrative distance will be installed. R1 will install and use the OSPF primary route with an administrative distance of 110.
R1 can send traffic through R2 and reach 192.168.3.0/24.

Floating Static Route on OSPF Failure
But now let me show you why the Floating Static Route is used. Imagine the link between R1 and R2 is down. The OSPF neighbor adjacency will go down and the route for the 192.168.3.0/24 network learned via OSPF will be lost.
Since the path with R1 -> R3 -> 192.168.3.0/24 does not use OSPF, a floating static route can be used. In case the primary route goes down, a static route with a higher administrative distance can be installed during the outage of the primary route.

Here, R1 will install the floating static route in its routing table and will be able to send traffic to 192.168.3.0/24.
Restoring the OSPF Route
When the link between R1 and R2 is restored, the OSPF route will be used again by the router because the router will always prefer a route with the lowest administrative distance.

Why Not Use OSPF Everywhere?
One question you can ask yourself is:
“Okay but why didn’t we use OSPF on all routers? OSPF can decide a new route.”
In fact, this is a good question, and the answer is pretty simple: sometimes, you cannot run a dynamic routing protocol everywhere.
R3 could be a router belonging to a client you have no control over, and no OSPF can be run on the link between R1 and R3, so the floating static route is the best solution.
2. Configure Floating Static Route
Let’s take a look at how we configure the floating static route on a Cisco router.
The command is the same as a static route, but instead of having an administrative distance of 1 (the default), you need to specify a higher administrative distance at the end of the command to tell the router how preferable this route is.
Since we want a higher administrative distance than 110 (used by OSPF), we can specify 130, for example.

In our topology, R1 and R2 have the 192.168.1.0/24 and 192.168.3.0/24 networks advertised in OSPF:
R1(config)# router ospf 1 R1(config-router)# network 192.168.1.0 0.0.0.255 area 0
R2(config)# router ospf 1 R2(config-router)# network 192.168.1.0 0.0.0.255 area 0 R2(config-router)# network 192.168.3.0 0.0.0.255 area 0
We can now check the routing table on R1:
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/1
L 192.168.2.1/32 is directly connected, GigabitEthernet0/1
O 192.168.3.0/24 [110/2] via 192.168.1.2, 00:00:57, GigabitEthernet0/0
Here, 192.168.3.0/24 is learned through OSPF with an administrative distance of 110, using the path through R2.
We can now configure the floating static route to 192.168.3.0/24 with an administrative distance of 130:
R1(config)# ip route 192.168.3.0 255.255.255.0 192.168.2.2 130
If we check the routing table again, the route to 192.168.3.0/24 is still learned through OSPF:
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/1
L 192.168.2.1/32 is directly connected, GigabitEthernet0/1
O 192.168.3.0/24 [110/2] via 192.168.1.2, 00:00:57, GigabitEthernet0/0
To see the floating static route in action, we can simulate a failure between R1 and R2.
Simulating a Failure
R1# show ip route R1# conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)# int g0/0 R1(config-if)# shutdown %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down 01:29:11: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
The primary route is now down, since OSPF lost its neighbor adjacency.

R1 can now use the backup route with an administrative distance of 130. Let’s verify this behavior in the routing table:
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/1
L 192.168.2.1/32 is directly connected, GigabitEthernet0/1
S 192.168.3.0/24 [130/0] via 192.168.2.2
Here, we can see the route installed by R1.
This route will stay in the routing table until the OSPF primary link is restored.
3. Summary
A Floating Static Route can be used as a backup route. This route always has a higher administrative distance than the primary route.
The route is installed only when the primary route is down. It stays in the background as long as it is not needed.
The configuration is simple:
You use the command
ip route <network> <mask> <next-hop> <administrative-distance>
This way, the router prefers the primary route first and only uses the floating static route when the main one fails.