Configure Floating Static Routes
Floating Static Routes
As with the other topics in this module, you will learn how to configure IPv4 and IPv6 floating static routes and when to use them.
Another type of static route is a floating static route. Floating static routes are static routes that are used to provide a backup path to a primary static or dynamic route, in the event of a link failure. The floating static route is only used when the primary route is not available.
To accomplish this, the floating static route is configured with a higher administrative distance than the primary route. The administrative distance represents the trustworthiness of a route. If multiple paths to the destination exist, the router will choose the path with the lowest administrative distance.
For example, assume that an administrator wants to create a floating static route as a backup to an EIGRP-learned route. The floating static route must be configured with a higher administrative distance than EIGRP. EIGRP has an administrative distance of 90. If the floating static route is configured with an administrative distance of 95, the dynamic route learned through EIGRP is preferred to the floating static route. If the EIGRP-learned route is lost, the floating static route is used in its place.
In the figure, the branch router typically forwards all traffic to the HQ router over the private WAN link. In this example, the routers exchange route information using EIGRP. A floating static route, with an administrative distance of 91 or higher, could be configured to serve as a backup route. If the private WAN link fails and the EIGRP route disappears from the routing table, the router selects the floating static route as the best path to reach the HQ LAN.
- A route learned through dynamic routing is preferred
- If a dynamic route is lost, the floating static route will be used
By default, static routes have an administrative distance of 1, making them preferable to routes learned from dynamic routing protocols. For example, the administrative distances of some common interior gateway dynamic routing protocols are:
- EIGRP = 90
- OSPF = 110
- IS-IS = 115
The administrative distance of a static route can be increased to make the route less desirable than that of another static route or a route learned through a dynamic routing protocol. In this way, the static route “floats” and is not used when the route with the better administrative distance is active. However, if the preferred route is lost, the floating static route can take over, and traffic can be sent through this alternate route.
Configure IPv4 and IPv6 Floating Static Routes
IP floating static routes are configured by using the distance argument to specify an administrative distance. If no administrative distance is configured, the default value (1) is used.
Refer to the topology in the figure and the ip route and ipv6 route commands issued on R1. In this scenario, the preferred default route from R1 is to R2. The connection to R3 should be used for backup only.
R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.2 R1(config)# ip route 0.0.0.0 0.0.0.0 10.10.10.2 5 R1(config)# ipv6 route ::/0 2001:db8:acad:2::2 R1(config)# ipv6 route ::/0 2001:db8:feed:10::2 5
R1 is configured with IPv4 and IPv6 default static routes pointing to R2. Because no administrative distance is configured, the default value (1) is used for these static routes. R1 is also configured with IPv4 and IPv6 floating static default routes pointing to R3 with an administrative distance of 5. This value is greater than the default value of 1 and therefore; this route floats and is not present in the routing table unless the preferred route fails.
The show ip route and show ipv6 route output verifies that the default routes to R2 are installed in the routing table. Note that the IPv4 floating static route to R3 is not present in the routing table.
R1# show ip route static | begin Gateway Gateway of last resort is 172.16.2.2 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 172.16.2.2 R1# show ipv6 route static | begin S : S ::/0 [1/0] via 2001:DB8:ACAD:2::2 R1#
Use the show run command to verify that floating static routes are in the configuration. For example, the following command output verifies that both IPv6 static default routes are in the running configuration.
R1# show run | include ipv6 route ipv6 route ::/0 2001:db8:feed:10::2 5 ipv6 route ::/0 2001:db8:acad:2::2 R1#
Test the Floating Static Route
In the figure, what would happen if R2 failed?
To simulate this failure, both serial interfaces of R2 are shut down, as shown in the configuration.
R2(config)# interface s0/1/0 R2(config-if)# shut *Sep 18 23:36:27.000: %LINK-5-CHANGED: Interface Serial0/1/0, changed state to administratively down *Sep 18 23:36:28.000: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to down R2(config-if)# interface s0/1/1 R2(config-if)# shut *Sep 18 23:36:41.598: %LINK-5-CHANGED: Interface Serial0/1/1, changed state to administratively down *Sep 18 23:36:42.598: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/1, changed state to down
Notice that R1 automatically generates messages indicating that the serial interface to R2 is down.
R1# *Sep 18 23:35:48.810: %LINK-3-UPDOWN: Interface Serial0/1/0, changed state to down R1# *Sep 18 23:35:49.811: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to down R1#
A look at the IP routing tables of R1 verifies that the floating static default routes are now installed as the default routes and are pointing to R3 as the next-hop router.
R1# show ip route static | begin Gateway Gateway of last resort is 10.10.10.2 to network 0.0.0.0 S* 0.0.0.0/0 [5/0] via 10.10.10.2 R1# show ipv6 route static | begin :: S ::/0 [5/0] via 2001:DB8:FEED:10::2 R1#