Sunday, March 2, 2014

Floating Static Routes

Lessons Learned:

-Static route with higher administrative distance used to backup another route.

-Routes must be if equal longest match.

 Static routes by default will always have an administrative distance One. Regardless is the route is pointing at a next-hop value or to the interface.

Note: the interface itself is a distance on Zero but the static route AD will always be one.

Example:

I have a static default route pointing to the upstream next-hop and also the interface.

R3#sh ip route static
12.0.0.0/24 is subnetted, 1 subnets
S 12.0.0.0 [1/0] via 30.0.0.2
S* 0.0.0.0/0 [1/0] via 12.0.0.2
is directly connected, FastEthernet0/0

Both the routes show up in the routing table with equal metrics.

If both entries show up in the routing table that implies there's an equal longest match between the two routes. In this case they both point the zero route and they both have an AD of "1".

For the Floating Static Route:

We can add the two default routes and then change the administrative distance of one of the routes to a higher metric.

Note: when we're looking at equal longest match between different protocols we are looking at the administrative distance. When looking at the equal longest match between the same protocol, then we are looking at the Metric.

So for static routes, if comparing static to say OSPF for example, then we're looking at the distance.

When comparing two static routes against each other, we're looking at the metric value. From a configuration perspective the Metric is the same as the distance.
EX:

ip route 0.0.0.0 0.0.0.0 12.0.0.2 3 - this basically installs a second default route but with an administrative / metric of "3". Which is larger than the connected and static AD.

Note: When we look to install a route in the routing table we must make sure that we can do a route recursion to the final destination. Example if you're routing to an interface - you need to make sure the interface shows up. if you issues and "Sh ip route connected" you need to see the interface in the route table as a connected link.

C 30.0.0.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 is directly connected, Serial0/0 -- Default static route - interface is up.

Note: since this is a serial p2p link, since my side of the line protocol link is up - this means the other side of the link's interface is up!

Floating routes -

One to interface and one to next hop. The next hop value has and AD of "2"

R3#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 30.0.0.1 2
ip route 0.0.0.0 0.0.0.0 Serial0/0

This means the default route to will prefer the one to the serial interface.

R3#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 30.0.0.3 YES manual up up
Serial0/0 10.1.1.3 YES manual up up

R3#traceroute 2.2.2.2

Type escape sequence to abort.
Tracing the route to 2.2.2.2

1 10.1.1.1 68 msec * 52 msec
R3#

Now - once the serial link goes down. The floating static route will be installed into the route table
Once the Serial Link comes back it will be reinstalled as the default route.

R3#traceroute 2.2.2.2

Type escape sequence to abort.
Tracing the route to 2.2.2.2

1 30.0.0.1 64 msec * 72 msec
R3#

Now that the Serial link is down we wil be using the floating static to the next hop address.
Gateway of last resort is 30.0.0.1 to network 0.0.0.0

 Note: the convergence time of the static route is directly related to the convergence time of the link itself.

Note: With dynamic protocols - you have to wait for the dead timer to expire before the routes are withdrawn from the routing table.

No comments:

Post a Comment