Configuration Example 10: Controlling Route Redistribution Based on Tag Values
In Figure 14-4, Router B is learning six routes via EIGRP. The EIGRP routes are redistributed into OSPF with the classful routes assigned a tag of 2 and the classless routes a tag of 1. Router A is redistributing the OSPF external routes into RIP-2. The policy is to redistribute only the classless routes into RIP-2. This can be accomplished using a route map and an IP access list. Because the external routes have been tagged, a route map can be used that redistributes only routes with a tag value equal to 1. Configure the routers as shown in the listing that follows the figure. Initially, all OSPF routes will be redistributed into RIP-2 on Router A.
Figure 14-4 A Route Map Can Be Used to Control Route Redistribution Based on the Tag Value
Router A interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Serial0/0 bandwidth 64 ip address 10.1.1.9 255.255.255.252 no ip mroute-cache ! interface Serial0/1 bandwidth 64 ip address 10.1.1.1 255.255.255.252 clockrate 64000 ! router ospf 1 network 10.1.1.0 0.0.0.3 area 0 ! router rip version 2 redistribute ospf 1 metric 1 passive-interface Serial0/1 network 10.0.0.0 no auto-summary
Router B interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Serial0 bandwidth 64 ip address 10.1.1.2 255.255.255.252 no ip directed-broadcast ! interface Serial1 bandwidth 64 ip address 10.1.1.5 255.255.255.252 clockrate 64000 ! ! router eigrp 1 network 10.0.0.0 ! router ospf 1 redistribute eigrp 1 subnets route-map set-tags network 10.1.1.0 0.0.0.3 area 0 ! access-list 1 permit 6.0.0.0 0.15.255.255 access-list 1 permit 146.6.0.0 0.0.15.255 access-list 1 permit 206.6.6.0 0.0.0.15 access-list 1 permit 10.1.1.4 0.0.0.3 route-map set-tags permit 10 match ip address 1 set tag 1 ! route-map set-tags permit 20 set tag 2
Router C interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface Loopback1 ip address 5.5.5.5 255.0.0.0 ! interface Loopback2 ip address 6.6.6.6 255.240.0.0 ! interface Loopback3 ip address 145.5.5.5 255.255.0.0 ! interface Loopback4 ip address 146.6.6.6 255.255.240.0 ! interface Loopback5 ip address 205.5.5.5 255.255.255.0 ! interface Loopback6 ip address 206.6.6.6 255.255.255.240 ! interface Serial0 bandwidth 64 ip address 10.1.1.6 255.255.255.252 no ip directed-broadcast ! router eigrp 1 network 5.0.0.0 network 6.0.0.0 network 10.0.0.0 network 145.5.0.0 network 146.6.0.0 network 205.5.5.0 network 206.6.6.0 no auto-summary Router D interface Serial0/1 ip address 10.1.1.10 255.255.255.252 clockrate 64000 ! router rip version 2 network 10.0.0.0
Verify that Router D is receiving the redistributed OSPF routes from Router A.
rtrD#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set R 205.5.5.0/24 [120/1] via 10.1.1.9, 00:00:01, Serial0/1 206.6.6.0/28 is subnetted, 1 subnets R 206.6.6.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 R 5.0.0.0/8 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 6.0.0.0/12 is subnetted, 1 subnets R 6.0.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 172.16.0.0/24 is subnetted, 1 subnets R 172.16.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 R 145.5.0.0/16 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 10.0.0.0/30 is subnetted, 3 subnets C 10.1.1.8 is directly connected, Serial0/1 R 10.1.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 R 10.1.1.4 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 146.6.0.0/20 is subnetted, 1 subnets R 146.6.0.0 [120/1] via 10.1.1.9, 00:00:05, Serial0/1
Modify the configuration on Router A so that only OSPF routes with a tag value of 1 get redistributed into RIP.
Router A router rip version 2 redistribute ospf 1 metric 1 route-map check-tags passive-interface Serial0/1 network 10.0.0.0 no auto-summary ! route-map check-tags permit 10 match tag 1
Verification
Verify that the only OSPF routes redistributed into RIP on Router A are those routes with a tag value of 1.
rtrD#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 206.6.6.0/28 is subnetted, 1 subnets R 206.6.6.0 [120/1] via 10.1.1.9, 00:00:01, Serial0/1 6.0.0.0/12 is subnetted, 1 subnets R 6.0.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 10.0.0.0/30 is subnetted, 3 subnets C 10.1.1.8 is directly connected, Serial0/1 R 10.1.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 R 10.1.1.4 [120/1] via 10.1.1.9, 00:00:02, Serial0/1 146.6.0.0/20 is subnetted, 1 subnets R 146.6.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1