CCNP ROUTE Lab: Route Redistribution and Administrative Distances
At this point in your ROUTE or TSHOOT studies, you know what administrative distance is, what it does, and you also have the AD value list down cold. We’re going to need all that information in this lab! Our objective: All routers should have the 10.1.1.0 /24 network in their routing tables.
The ASBR in this lab is R3, and in any lab involving an ASBR, our first step is to make sure the ASBR has the route to be redistributed. (If not, that makes successful redistribution just a bit more difficult.) I’ll include R2’s RIP table as well.
R3#show ip route rip 10.0.0.0/24 is subnetted, 1 subnets R 10.1.1.0 [120/1] via 172.12.123.1, 00:00:20, Serial0/1/0 R2#show ip route rip 10.0.0.0/24 is subnetted, 1 subnets R 10.1.1.0 [120/1] via 172.12.123.1, 00:00:27, Serial0/1/0
Both R2 and R3 are border routers, so it’s a good idea to watch the effects of this lab on both routers.
R3 will be the only router on which we perform redistribution. Let’s redistribute the RIP subnet and the connected subnet (172.12.123.0 /24) into OSPF, accepting the default OSPF seed metric of 20…
R3(config)#router ospf 1 R3(config-router)#redistribute rip subnets R3(config-router)#redistribute connected subnets
… and the connected route 30.1.1.0 /24 into RIP, along with a seed metric of 2.
R3(config)#router rip R3(config-router)#redistribute connected metric 2
Let’s have a look at the routing tables on R4 and R5 and see if both routers see 10.1.1.0 /24 and 172.12.123.0 /24, followed by a ping test.
R4#show ip route ospf 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 30.1.1.3, 00:01:00, FastEthernet0/0 172.12.0.0/24 is subnetted, 1 subnets O E2 172.12.123.0 [110/20] via 30.1.1.3, 00:01:00, FastEthernet0/0
R4#ping 10.1.1.1 Type escape sequence to abort. !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/66/68 ms R4#ping 172.12.123.1 Type escape sequence to abort. !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/65/68 ms
R5#show ip route ospf 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 30.1.1.3, 00:01:06, GigabitEthernet0/0 172.12.0.0/24 is subnetted, 1 subnets O E2 172.12.123.0 [110/20] via 30.1.1.3, 00:01:06, GigabitEthernet0/0
R5#ping 10.1.1.1 Type escape sequence to abort. !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/64/68 ms R5#ping 172.12.123.1 Type escape sequence to abort. !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/64/68 ms
Looks good! Before we leave, let’s have a look at R2’s RIP table.
R2#show ip route rip <empty>
Hmm. Maybe we better stick around a while. What about the OSPF table?
R2#show ip route ospf 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 30.1.1.3, 00:04:24, FastEthernet0/0
R2 is now showing an OSPF route where it once had a RIP route, and that “once had” time was before route redistribution. Why the change? R2 is now hearing about the 10.1.1.0 route from two sources. R1 is advertising that route over the RIP domain, and R3 is advertising it via OSPF.
The prefix length is exactly the same in both ads, and that’s where admin distance comes in. The OSPF route is preferred over the RIP route, since OSPF’s AD is 110 and RIP’s is 120. Before redistribution, packets from R2 to 10.1.1.0 /24 would go straight to R1, using 172.12.123.1 as the next-hop IP address. Here’s R2’s routing table before redistribution:
R2#show ip route rip 10.0.0.0/24 is subnetted, 1 subnets R 10.1.1.0 [120/1] via 172.12.123.1, 00:00:27, Serial0/1/0
After redistribution, that route is now an OSPF route using 30.1.1.3 as the next-hop address.
R2#show ip route ospf 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 30.1.1.3, 00:04:24, FastEthernet0/0
Packets from R2 must now go through the Ethernet segment before being sent across the cloud to R1.
That suboptimal path is verified by traceroute.
R2#traceroute 10.1.1.1 Type escape sequence to abort. Tracing the route to 10.1.1.1 1 30.1.1.3 0 msec 0 msec 0 msec 2 172.12.123.1 32 msec * 32 msec
Obviously, we’d like to get rid of this suboptimal routing and have traffic leaving R2 headed for 10.1.1.0 /24 go straight across the cloud to R1. Changing the admin distance of our OSPF route just might help us out, so now’s a good time to bring in the distance command.
R2(config)#router ospf 1 R2(config-router)#distance ? <1-255> Administrative distance ospf OSPF distance R2(config-router)#distance 121
The effect is immediate. The RIP route is back in R2’s routing table since it now has a lower AD that the matching OSPF route (120 vs. 121). The RIP route is now used to reach 10.1.1.0, verified by two show ip route commands and traceroute.
R2#show ip route ospf (nothing here) R2#show ip route rip 10.0.0.0/24 is subnetted, 1 subnets R 10.1.1.0 [120/1] via 172.12.123.1, 00:00:18, Serial0/1/0
R2#traceroute 10.1.1.1 Type escape sequence to abort. Tracing the route to 10.1.1.1 1 172.12.123.1 32 msec * 32 msec
Should that RIP route leave the table, the OSPF route should re-enter it. To test that, let’s close R2’s serial interface to get rid of the RIP route and then check the OSPF table.
R2(config)#int serial 0/1/0 R2(config-if)#shut %SYS-5-CONFIG_I: Configured from console by console %LINK-5-CHANGED: Interface Serial0/1/0, changed state to administratively down %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
R2#show ip route ospf 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [121/20] via 30.1.1.3, 00:00:08, FastEthernet0/0 172.12.0.0/24 is subnetted, 1 subnets O E2 172.12.123.0 [121/20] via 30.1.1.3, 00:00:08, FastEthernet0/0
Note the admin distance of both OSPF routes. (172.12.123.0 is now shown as an OSPF route since it’s no longer directly connected to R2 after we shut that serial interface down.) The path is again verified by traceroute and connectivity is verified with ping.
R2#traceroute 10.1.1.0 Type escape sequence to abort. Tracing the route to 10.1.1.0 1 30.1.1.3 4 msec 0 msec 0 msec 2 172.12.123.1 36 msec 32 msec 32 msec
R2#ping 10.1.1.1 Type escape sequence to abort. !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/65/68 ms
We’ve turned the OSPF route to 10.1.1.0 /24 into something like a floating static route. The higher AD guarantees that an OSPF entry for a given route will enter the routing table only if the RIP entry for the exact same route disappears.
The only drawback to distance is the “all or nothing” admin distance change. With larger OSPF tables, you may want to change the AD of particular routes rather than all routes. I’ll show you how to do that after I add two additional routes to R1’s RIP process, reopen R2’s serial interface, and remove the distance command from R2’s OSPF configuration.
R1(config)#int loopback 5 R1(config-if)#ip address 5.5.5.5 255.255.255.0 R1(config-if)#int loopback6 R1(config-if)#ip address 6.6.6.6 255.255.255.0 R1(config-if)#router rip R1(config-router)#network 5.0.0.0 R1(config-router)#network 6.0.0.0
R2(config)#int serial 0/1/0 R2(config-if)#no shut %LINK-3-UPDOWN: Interface Serial0/1/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up R2(config-if)#router ospf 1 R2(config-router)#no distance 121
R2 sees all three routes now redistributed into OSPF, the AD for all three routes is 110, and 30.1.1.3 is the next-hop address for each route. Since the OSPF AD is the default of 110, these OSPF entries are preferred over the RIP updates for those same networks. Packets leaving R2 and destined for any of those three networks are going through R3.
R2#show ip route ospf 5.0.0.0/24 is subnetted, 1 subnets O E2 5.5.5.0 [110/20] via 30.1.1.3, 00:00:37, FastEthernet0/0 6.0.0.0/24 is subnetted, 1 subnets O E2 6.6.6.0 [110/20] via 30.1.1.3, 00:00:37, FastEthernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 30.1.1.3, 00:00:37, FastEthernet0/0
Now, just for fun (and our demo), we’d like traffic leaving R2 and headed for 10.1.1.0 /24 to take the direct path to R1 while leaving the other two routes alone to take the longer path.
We’re still going to use distance, but since we don’t want to change the AD of all our OSPF routes, we’ll use an ACL to identify the routes that will have their AD changed — in this case, one route in particular.
R2(config)#access-list 77 permit 10.1.1.0 0.0.0.255
We’ll use the distance command along with this ACL to change the distance of that one particular route. I could tie the source address down in the distance command, but instead I’ll make it apply to any source with the source address of 0.0.0.0 and a wildcard mask of all 1s. If you enter a specific source address here, it must be the OSPF RID of the source, even if that RID is not the IP address of the interface sending the updates.
R2(config)#router ospf 1 R2(config-router)#distance 121 ? A.B.C.D IP Source address <cr> R2(config-router)#distance 121 0.0.0.0 ? A.B.C.D Wildcard bits R2(config-router)#distance 121 0.0.0.0 255.255.255.255 ? <1-99> IP Standard access list number <1300-1999> IP Standard expanded access list number WORD Standard access-list name <cr> R2(config-router)#distance 121 0.0.0.0 255.255.255.255 77
Just as it was earlier, the result of distance is immediate. The full IP routing table shows the RIP route to 10.1.1.0 /24 is now preferred since the OSPF entry for that route now has an AD of 121. The OSPF routes for the two newest routes are still in that table; they’re still preferred over RIP routes since their ADs remain at 110.
R2#show ip route 5.0.0.0/24 is subnetted, 1 subnets O E2 5.5.5.0 [110/20] via 30.1.1.3, 00:00:11, FastEthernet0/0 6.0.0.0/24 is subnetted, 1 subnets O E2 6.6.6.0 [110/20] via 30.1.1.3, 00:00:11, FastEthernet0/0 10.0.0.0/24 is subnetted, 1 subnets R 10.1.1.0 [120/1] via 172.12.123.1, 00:00:08, Serial0/1/0
Shutting down R2’s serial interface again puts the OSPF route for 10.1.1.0/24 back in the table. Note the AD of that route is indeed 121 while the others stay at 110.
R2(config)#int serial 0/1/0 R2(config-if)#shut %LINK-5-CHANGED: Interface Serial0/1/0, changed state to administratively down %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to down
R2#show ip route 5.0.0.0/24 is subnetted, 1 subnets O E2 5.5.5.0 [110/20] via 30.1.1.3, 00:04:02, FastEthernet0/0 6.0.0.0/24 is subnetted, 1 subnets O E2 6.6.6.0 [110/20] via 30.1.1.3, 00:04:02, FastEthernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [121/20] via 30.1.1.3, 00:00:06, FastEthernet0/0
This lab really brings home the fact that you can’t just look out for routing loops when it comes to route redistribution. You’ve got to watch those ADs to avoid suboptimal routing.
Catch your breath and dive into these other CCNP ROUTE and TSHOOT route redistribution tutorials, and check out Chris Bryant’s CCNP ROUTE Study Guide on Amazon, too!