So now we know all about configuring RIP we are going to play with it a little. In this lab we build on what we did in the last lab. We are using the frame relay network, with the loopbacks, but we are adding a few extra connections. We are going to demonstrate what happens when we change administrative distances, add floating static routes.
RIP V2 is running on all three routers, but RIP is NOT running (for what ever reason) on the route 220.127.116.11/24
So the plan here is to use the 18.104.22.168 connection, only in the event that the Frame Relay connections go down. If we try a to add a simple static route, here is what happens:
r2610xm#sh ip route rip 22.214.171.124/16 is variably subnetted, 2 subnets, 2 masks R 126.96.36.199/27 [120/1] via 188.8.131.52, 00:00:05, Serial0/1 [120/1] via 184.108.40.206, 00:00:20, Serial0/1
Lets add our static route:
r2610xm(config)#ip route 127.12.23.0 255.255.255.224 220.127.116.11
… to get the 18.104.22.168 network, we will add the static route via the 22.214.171.124 link (.3 is the router 3 end).
So what happens to the routing table?
r2610xm#sh ip route rip r2610xm#
So our RIP routes have gone and if we look at the routing table we have:
r2610xm#sh ip route 126.96.36.199/16 is variably subnetted, 2 subnets, 2 masks S 188.8.131.52/27 [1/0] via 184.108.40.206 C 220.127.116.11/24 is directly connected, Serial0/1 18.104.22.168/24 is variably subnetted, 2 subnets, 2 masks C 22.214.171.124/32 is directly connected, Serial0/0 C 126.96.36.199/24 is directly connected, Serial0/0 r2610xm#
And we can see from the routing table that the static route has displaced our RIP route. So what happened.?
It all comes down to administrative distance, and unintended consequences. When the router gets two routes to the same network, it looks at the administrative distance of both, and the lower admin distance gets loaded into the routing table. The Static route has a lower administrative distance, so it is the route that gets loaded.
What we need is for the RIP route to remain in the table until such time that route drops, then the static route takes over. This is known as a floating static route and is what this lab is all about.
Floating Static Routes
So how do we create a static route that will only be present when the RIP route has gone down? We do this by playing with the administrative distance. If we give the route an administrative distance greater than the RIP route (which has a default of 120) we can ‘fool’ the router in to using the rip route, but it will then fall back to the static route if the RIP route fails. We do this as follows:
r2610xm(config)#ip route 188.8.131.52 255.255.255.224 184.108.40.206 ? <1-255> Distance metric for this route name Specify name of the next hop permanent permanent route tag Set tag for this route track Install route depending on tracked item <cr> r2610xm(config)#ip route 220.127.116.11 255.255.255.224 18.104.22.168 125
So we use the same command syntax as we did with the ordinary static route, but we add the administrative distance for the route at the end. You can see from the above that there are a number of options available to us.
Now when we do a sh ip route rip, we still see the RIP route in place:
r2610xm#sh ip route rip 22.214.171.124/16 is variably subnetted, 2 subnets, 2 masksR 126.96.36.199/27 [120/1] via 188.8.131.52, 00:00:16, Serial0/1 [120/1] via 184.108.40.206, 00:00:21, Serial0/1
So lets test this theory! If we close the interface serial0/1 (the interface to the frame relay) we should see the new floating static route take effect.
r2610xm(config)#int ser0/1 r2610xm(config-if)#shut r2610xm(config-if)#^Z r2610xm#sh *Feb 13 12:11:49.213: %LINK-5-CHANGED: Interface Serial0/1, changed state to administratively down *Feb 13 12:11:49.298: %SYS-5-CONFIG_I: Configured from console by console *Feb 13 12:11:50.215: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down r2610xm#sh ip route rip r2610xm#sh ip route 220.127.116.11/27 is subnetted, 1 subnets S 18.104.22.168 [125/0] via 22.214.171.124 126.96.36.199/24 is variably subnetted, 2 subnets, 2 masks C 188.8.131.52/32 is directly connected, Serial0/0 C 184.108.40.206/24 is directly connected, Serial0/0
We can see the frame relay link go down, and the RIP routes have gone. We can also see our floating static route now in the routing table. If the link comes back up, the router automatically will put the the new RIP routes in the routing table, displacing the floating static route.
A few final notes:
- RIP will run in a multi vendor environment
- Use show ip protocols and debug ip rip for debugging
- most issues with RIP are going to be config issues
- RIP uses the Bellman-ford algorithm
- Hop counts are not a great metric for routing!
- 220.127.116.11 is the RIPv2 multicast address