Floating Static Routes

Problem

You want to use a static route only when the dynamic route is not available.

Solution

The router will use a floating static route for a particular network prefix only if that same route is not available from the dynamic routing protocol. You can accomplish this by setting the administrative distance of the static route to a value greater than the administrative distance of the dynamic routing protocol:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 10.0.0.0 255.0.0.0 172.16.1.1 190
Router(config)#end
Router#

You can use the floating static to trigger a dialer interface as follows:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 0.0.0.0 0.0.0.0 Dialer1 190
Router(config)#end
Router#

Discussion

The static routes that we discussed in the previous section all had relatively low administrative distance values. If the router has two routes to the same destination but with different distances, it will always choose the one with the lower distance value. This concept also includes the routes that come from other sources, such as dynamic routing protocols.

Every routing protocol has an administrative distance that indicates how much the router trusts the information it receives by this method. Table 5-3 shows the default values for these administrative distances. Recipe 5.7 demonstrates how to change these values when they are not appropriate ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.