| R1#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 3 subnets C 10.0.9.0 is directly connected, Serial0/0 C 10.0.0.0 is directly connected, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/1 D EX 192.168.254.0/24 [170/18311936] via 10.0.9.5, 00:01:33, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18311936] via 10.0.9.5, 00:01:33, Serial0/0 |
| R2#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets D 10.0.9.0 [90/5514496] via 10.0.0.1, 01:06:53, FastEthernet0/0 C 10.0.2.0 is directly connected, Serial0/0 O 10.0.3.0 [110/128] via 10.0.2.4, 00:11:11, Serial0/0 C 10.0.0.0 is directly connected, FastEthernet0/0 D 10.0.1.0 [90/30720] via 10.0.0.1, 01:10:59, FastEthernet0/0 D EX 192.168.254.0/24 [170/18314496] via 10.0.0.1, 00:03:03, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.0.1, 00:03:03, FastEthernet0/0 |
| R3#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets D 10.0.9.0 [90/5514496] via 10.0.1.1, 01:07:16, FastEthernet0/0 O 10.0.2.0 [110/128] via 10.0.3.4, 00:11:33, Serial0/0 C 10.0.3.0 is directly connected, Serial0/0 D 10.0.0.0 [90/30720] via 10.0.1.1, 01:11:22, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/0 D EX 192.168.254.0/24 [170/18314496] via 10.0.1.1, 00:03:26, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.1.1, 00:03:26, FastEthernet0/0 |
| R4#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 2 subnets C 10.0.2.0 is directly connected, Serial0/0 C 10.0.3.0 is directly connected, Serial0/1 |
After verifying the routes, mutual redistribution between EIGRP and OSPF is configured on the two ASBRs, R2 and R3. This is performed as follows:
| R2(config)#router ospf 2 R2(config-router)#redistribute eigrp 1 subnets R2(config-router)#exit R2(config)#router eigrp 1 R2(config-router)#redistribute ospf 2 metric 100000 10 255 1 1500 R2(config-router)#exit |
| R3(config)#router ospf 3 R3(config-router)#redistribute eigrp 1 subnets R3(config-router)#exit R3(config)#router eigrp 1 R3(config-router)#redistribute ospf 3 metric 100000 10 255 1 1500 R3(config-router)#exit |
After redistribution, we will revisit the routing tables on each of the routers, beginning with R2:
| R2#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets D 10.0.9.0 [90/5514496] via 10.0.0.1, 01:22:55, FastEthernet0/0 C 10.0.2.0 is directly connected, Serial0/0 O 10.0.3.0 [110/128] via 10.0.2.4, 00:02:52, Serial0/0 C 10.0.0.0 is directly connected, FastEthernet0/0 D 10.0.1.0 [90/30720] via 10.0.0.1, 01:27:01, FastEthernet0/0 D EX 192.168.254.0/24 [170/33280] via 10.0.0.1, 00:02:43, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/33280] via 10.0.0.1, 00:02:43, FastEthernet0/0 |
In the output above, R2 is showing the correct outbound interface for all the EIGRP and OSPF routes. This router will have no problems getting to the subnets in either domain. Moving on, the routing table on R4 shows the following entries:
| R4#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets O E2 10.0.9.0 [110/20] via 10.0.2.2, 00:03:32, Serial0/0 [110/20] via 10.0.3.3, 00:03:32, Serial0/1 C 10.0.2.0 is directly connected, Serial0/0 C 10.0.3.0 is directly connected, Serial0/1 O E2 10.0.0.0 [110/20] via 10.0.2.2, 00:03:32, Serial0/0 [110/20] via 10.0.3.3, 00:03:32, Serial0/1 O E2 10.0.1.0 [110/20] via 10.0.2.2, 00:03:32, Serial0/0 [110/20] via 10.0.3.3, 00:03:32, Serial0/1 O E2 192.168.254.0/24 [110/20] via 10.0.2.2, 00:03:32, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets O E2 192.168.253.0 [110/20] via 10.0.2.2, 00:03:32, Serial0/0 |
In the output above, R4 is learning about the 10.0.0.0, 10.0.1.0 and 10.0.9.0 EIGRP subnets from both R2 and R3, given that EIGRP routes were redistributed into OSPF on both routers using the same (default) metric. However, R4 is only learning about the 192.168.253.0 and 192.168.254.0 from R2. This is where the problems begin. The reason that R4 is only learning about the 192.168.253.0 and 192.168.254.0 from R2 is because when EIGRP was redistributed into OSPF on R2, the routes we propagated throughout the OSPF domain to R3 as external routes. These routes were then installed into the routing table as OSPF routes, and not EIGRP routes. Given this, the routing table on R3 shows the following entries:
| R3#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets D 10.0.9.0 [90/5514496] via 10.0.1.1, 01:23:52, FastEthernet0/0 O 10.0.2.0 [110/128] via 10.0.3.4, 00:03:49, Serial0/0 C 10.0.3.0 is directly connected, Serial0/0 D 10.0.0.0 [90/30720] via 10.0.1.1, 01:27:58, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/0 O E2 192.168.254.0/24 [110/20] via 10.0.3.4, 00:03:49, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets O E2 192.168.253.0 [110/20] via 10.0.3.4, 00:03:49, Serial0/0 |
In the output above, R3 is learning about the 10.0.0.0 and 10.0.9.0 via EIGRP. These are internal EIGRP routes and are therefore preferred over the external routes redistributed into OSPF by router R2. The 10.0.2.0 route is learned is for the subnet between R2 and R4. This is an internal OSPF route. However, unlike R2, R3 prefers the 192.168.253.0 and 192.168.254.0 routes advertised by OSPF instead of EIGRP because the routes redistributed into OSPF on R2 have a lower administrative distance than the external EIGRP routes advertised by R1.
Because R3 prefers the 192.168.253.0 and 192.168.254.0 routes received via OSPF, when mutual redistribution is configured between EIGRP and OSPF on R3, these same routes will be redistributed into EIGRP and re-advertised back into the EIGRP domain. As a result of this behavior, the routing table on R1 shows the following network entries:
| R1#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets C 10.0.9.0 is directly connected, Serial0/0 D EX 10.0.2.0 [170/30720] via 10.0.0.2, 00:34:02, FastEthernet0/0 [170/30720] via 10.0.1.3, 00:34:02, FastEthernet0/1 D EX 10.0.3.0 [170/30720] via 10.0.0.2, 00:34:02, FastEthernet0/0 [170/30720] via 10.0.1.3, 00:34:02, FastEthernet0/1 C 10.0.0.0 is directly connected, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/1 D EX 192.168.254.0/24 [170/30720] via 10.0.1.3, 00:34:02, FastEthernet0/1 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/30720] via 10.0.1.3, 00:34:02, FastEthernet0/1 |
Based on the output of R1s routing table, a routing loop has been created. As an example, let us assume that a packet from R4 is sent to the 192.168.253.0 subnet. R4 will forward this to R2. R2 receives the packet and forwards it to R1. R1 receives the packet and forwards it to R3. R3 receives the same packet and forwards it to R4. The entire process is repeated continuously until the TTL field in the packet reaches zero, after which the packet is discarded. To validate this theory, we will perform a Traceroute from R4 to the 192.168.253.1 address as follows:
| R4#traceroute ip 192.168.253.1Type escape sequence to abort. Tracing the route to 192.168.253.11 R2-Se0-Interface (10.0.2.2) 4 msec 4 msec 4 msec 2 R1-Fa0-Interface (10.0.0.1) 4 msec 4 msec 4 msec 3 R3-Fa0-Interface (10.0.1.3) 4 msec 4 msec 0 msec 4 R4-Se1-Interface (10.0.3.4) 4 msec 4 msec 4 msec 5 R2-Se0-Interface (10.0.2.2) 4 msec 0 msec 0 msec 6 R1-Fa0-Interface (10.0.0.1) 4 msec 4 msec 4 msec 7 R3-Fa0-Interface (10.0.1.3) 0 msec 4 msec 4 msec 8 R4-Se1-Interface (10.0.3.4) 4 msec 4 msec 4 msec 9 R2-Se0-Interface (10.0.2.2) 0 msec 4 msec 4 msec 10 R1-Fa0-Interface (10.0.0.1) 4 msec 8 msec 4 msec 11 R3-Fa0-Interface (10.0.1.3) 4 msec 4 msec 4 msec 12 R4-Se1-Interface (10.0.3.4) 8 msec 4 msec 4 msec 13 R2-Se0-Interface (10.0.2.2) 4 msec 4 msec 4 msec 14 R1-Fa0-Interface (10.0.0.1) 4 msec 8 msec 4 msec 15 R3-Fa0-Interface (10.0.1.3) 4 msec 4 msec 4 msec 16 R4-Se1-Interface (10.0.3.4) 8 msec 4 msec 4 msec 17 R2-Se0-Interface (10.0.2.2) 4 msec 8 msec 4 msec 18 R1-Fa0-Interface (10.0.0.1) 4 msec 4 msec 8 msec 19 R3-Fa0-Interface (10.0.1.3) 4 msec 4 msec 8 msec 20 R4-Se1-Interface (10.0.3.4) 4 msec 4 msec 4 msec 21 R2-Se0-Interface (10.0.2.2) 4 msec 4 msec 8 msec 22 R1-Fa0-Interface (10.0.0.1) 8 msec 8 msec 8 msec 23 R3-Fa0-Interface (10.0.1.3) 4 msec 4 msec 4 msec 24 R4-Se1-Interface (10.0.3.4) 4 msec 8 msec 8 msec 25 R2-Se0-Interface (10.0.2.2) 8 msec 8 msec 8 msec 26 R1-Fa0-Interface (10.0.0.1) 8 msec 8 msec 8 msec 27 R3-Fa0-Interface (10.0.1.3) 8 msec 4 msec 4 msec 28 R4-Se1-Interface (10.0.3.4) 8 msec 8 msec 8 msec 29 R2-Se0-Interface (10.0.2.2) 4 msec 8 msec 8 msec 30 R1-Fa0-Interface (10.0.0.1) 8 msec 8 msec 8 msec |
NOTE: R4 is configured to query a DNS server for IP to hostname address resolution which is why the router interface names appear in the output of the Traceroute.
In the Traceroute output above, we can confirm that a routing loop has indeed formed based on the implemented route redistribution configuration. The routing loop is caused primarily because of the redistribution metric applied when OSPF routes were redistributed into EIGRP on R2 and R3. The result of the configuration is that R1 prefers the external routes that are redistributed into EIGRP from R3 for the 192.168.253.0 and 192.168.254.0 subnets, versus the external routes advertised to R1 by its downstream neighbor. The EIGRP Topology table shows the following entries for the 192.168.253.0 subnet:
| R1#show ip eigrp topology 192.168.253.0 255.255.255.248 IP-EIGRP (AS 1): Topology entry for 192.168.253.0/29 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 30720 Routing Descriptor Blocks: 10.0.1.3 (FastEthernet0/1), from 10.0.1.3, Send flag is 0x0 Composite metric is (30720/28160), Route is External Vector metric: Minimum bandwidth is 100000 Kbit Total delay is 200 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 External data: Originating router is 10.0.3.3 AS number of route is 3 External protocol is OSPF, external metric is 20 Administrator tag is 0 (0x00000000) 10.0.9.5 (Serial0/0), from 10.0.9.5, Send flag is 0x0 Composite metric is (18311936/17799936), Route is External Vector metric: Minimum bandwidth is 512 Kbit Total delay is 520000 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 External data: Originating router is 192.168.254.1 AS number of route is 0 External protocol is Connected, external metric is 0 Administrator tag is 0 (0x00000000) |
Likewise, the EIGRP Topology table shows the following entries for the 192.168.254.0 subnet:
| R1#show ip eigrp topology 192.168.254.0 255.255.255.0 IP-EIGRP (AS 1): Topology entry for 192.168.254.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 30720 Routing Descriptor Blocks: 10.0.1.3 (FastEthernet0/1), from 10.0.1.3, Send flag is 0x0 Composite metric is (30720/28160), Route is External Vector metric: Minimum bandwidth is 100000 Kbit Total delay is 200 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 External data: Originating router is 10.0.3.3 AS number of route is 3 External protocol is OSPF, external metric is 20 Administrator tag is 0 (0x00000000) 10.0.9.5 (Serial0/0), from 10.0.9.5, Send flag is 0x0 Composite metric is (18311936/17799936), Route is External Vector metric: Minimum bandwidth is 512 Kbit Total delay is 520000 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 External data: Originating router is 192.168.254.1 AS number of route is 0 External protocol is Connected, external metric is 0 Administrator tag is 0 (0x00000000) |
In both outputs, the route redistributed into EIGRP by R3 is preferred over the route advertised to R1 by its downstream neighbor. There are several methods that can be used to resolve this issue. These methods include the following:
- Redistributing OSPF routes with a worse (higher) metric
- Filtering routes using distribute lists
- Changing the default administrative distance values
- Using route map filtering during redistribution
The first method is simple. On both R2 and R3, OSPF routes are redistributed into the EIGRP domain using higher metric than that for the external route received by R1 from its downstream neighbor. As an example, OSPF could be redistributed into EIGRP on both routers as follows:
| R2(config)#router eigrp 1 R2(config-router)#redistribute ospf 2 metric 256 500000 255 1 1500 R2(config-router)#exit |
| R3(config)#router eigrp 1 R3(config-router)#redistribute ospf 3 metric 256 500000 255 1 1500 R3(config-router)#exit |
Following this configuration, R1 prefers the routes via its downstream neighbor (R5) to the 192.168.253.0 and 192.168.254.0 subnets as follows:
| R1#show ip route eigrp | include 192.168 D EX 192.168.254.0/24 [170/18311936] via 10.0.9.5, 00:00:09, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18311936] via 10.0.9.5, 00:00:09, Serial0/0 |
R4 is now able to reach the 192.168.253.1 address as shown in the following Traceroute:
| R4#traceroute ip 192.168.253.1Type escape sequence to abort. Tracing the route to 192.168.253.11 R2-Se0-Interface (10.0.2.2) 4 msec 4 msec 4 msec 2 R1-Fa0-Interface (10.0.0.1) 4 msec 4 msec 4 msec 3 R5-Se0-Interface (10.0.9.5) 0 msec * 4 msec |
Keep in mind that this option addresses one of the two issues, which is the routing loop. It does not, however, address the suboptimal routing to the 192.168.253.0 and 192.68.254.0 subnets on R3 which still prefers the OSPF routes over the external EIGRP routes:
| R3#show ip route | include 192.168. O E2 192.168.254.0/24 [110/20] via 10.0.3.4, 00:29:54, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets O E2 192.168.253.0 [110/20] via 10.0.3.4, 00:29:54, Serial0/0 |
Using the second methods, either OSPF or EIGRP distribute lists can be configured on R2 and R3 to resolve the routing loop. The following example illustrates how to configure inbound distribute lists on R2 and R3 filtering all external routes originated by either one of the routers:
| R2(config)#route-map DENY-OSPF-EXTERNAL-FROM-R3 deny 10 R2(config-route-map)#match source-protocol ospf 3 R2(config-route-map)#match route-type external R2(config-route-map)#exit R2(config)#route-map DENY-OSPF-EXTERNAL-FROM-R3 permit 20 R2(config-route-map)#exit R2(config)#router ospf 2 R2(config-router)#distribute-list route-map DENY-OSPF-EXTERNAL-FROM-R3 in R2(config-router)# |
| R3(config)#route-map DENY-OSPF-EXTERNAL-FROM-R2 deny 10 R3(config-route-map)#match source-protocol ospf 2 R3(config-route-map)#match route-type external R3(config-route-map)#exit R3(config)#route-map DENY-OSPF-EXTERNAL-FROM-R2 permit 20 R3(config-route-map)#exit R3(config)#router ospf 3 R3(config-router)#distribute-list route-map DENY-OSPF-EXTERNAL-FROM-R2 in R3(config-router)#exit |
This solution addresses both the suboptimal routing issue on R3 as well as the routing loop that was caused by the mutual redistribution. The routing tables on R2 and R3 show as follows:
| R2#show ip route | include 192.168 D EX 192.168.254.0/24 [170/18314496] via 10.0.0.1, 00:34:37, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.0.1, 00:34:37, FastEthernet0/0 |
| R3#show ip route | include 192.168 D EX 192.168.254.0/24 [170/18314496] via 10.0.1.1, 00:34:52, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.1.1, 00:34:52, FastEthernet0/0 |
NOTE: When using distribute lists, it is important to understand the impact your filtering will have on downstream routers. For example, incorrect configuration on R2 and R3 would effectively prevent those two routers from learning about the 192.168.253.0 and 192.168.254.0 prefixes via OSPF; however, it may also result in these subnets not being advertised to R4. Because of the implementation of the distribute list, this potential pitfall is averted and the RIB on router R4 still contains all route entries as illustrated below:
| R4#show ip route ospf 10.0.0.0/24 is subnetted, 5 subnets O E2 10.0.9.0 [110/20] via 10.0.2.2, 01:23:34, Serial0/0 [110/20] via 10.0.3.3, 01:23:34, Serial0/1 O E2 10.0.0.0 [110/20] via 10.0.2.2, 01:23:34, Serial0/0 [110/20] via 10.0.3.3, 01:23:34, Serial0/1 O E2 10.0.1.0 [110/20] via 10.0.3.3, 01:23:35, Serial0/1 [110/20] via 10.0.2.2, 01:23:35, Serial0/0 O E2 192.168.254.0/24 [110/20] via 10.0.3.3, 00:35:23, Serial0/1 [110/20] via 10.0.2.2, 00:35:23, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets O E2 192.168.253.0 [110/20] via 10.0.3.3, 00:35:23, Serial0/1 [110/20] via 10.0.2.2, 00:35:23, Serial0/0 |
Again, to validate our configuration, a Traceroute from R4 to 192.168.253.1 is performed:
| R4#traceroute ip 192.168.253.1Type escape sequence to abort. Tracing the route to 192.168.253.11 R2-Se0-Interface (10.0.2.2) 0 msec R3-Se0-Interface (10.0.3.3) 4 msec R2-Se0-Interface (10.0.2.2) 4 msec 2 R1-Fa1-Interface (10.0.1.1) 4 msec R1-Fa0-Interface (10.0.0.1) 0 msec R1-Fa1-Interface (10.0.1.1) 0 msec 3 R5-Se0-Interface (10.0.9.5) 4 msec * 4 msec |
NOTE: Because both the suboptimal routing and routing loop issue have been resolved, R4 is able to load share between the paths via routers R2 and R3.
The third method that could be used would be to increment the administrative distance values for OSPF to a value higher than that assigned to external EIGRP routes as illustrated below:
| R3(config)#router ospf 3 R3(config-router)#distance ospf external 175 R3(config-router)#exit |
| R2(config)#router ospf 2 R2(config-router)#distance ospf external 175 R2(config-router)#exit |
Following this configuration, the routing tables on R2 and R3 show the following route entries:
| R2#show ip route | include 192.168 D EX 192.168.254.0/24 [170/18314496] via 10.0.0.1, 00:00:20, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.0.1, 00:00:20, FastEthernet0/0 |
| R3#show ip route | include 192.168 D EX 192.168.254.0/24 [170/18314496] via 10.0.1.1, 00:01:30, FastEthernet0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18314496] via 10.0.1.1, 00:01:30, FastEthernet0/0 |
Once again we can use a Traceroute from R4 to the 192.168.253.1 address for verification:
| R4#traceroute ip 192.168.253.1Type escape sequence to abort. Tracing the route to 192.168.253.11 R3-Se0-Interface (10.0.3.3) 4 msec R2-Se0-Interface (10.0.2.2) 0 msec R3-Se0-Interface (10.0.3.3) 4 msec 2 R1-Fa0-Interface (10.0.0.1) 4 msec R1-Fa1-Interface (10.0.1.1) 4 msec R1-Fa0-Interface (10.0.0.1) 4 msec 3 R5-Se0-Interface (10.0.9.5) 4 msec * 4 msec |
The final solution requires a lot more configuration but is the recommended solution because of its scalability. This method uses a route map during redistribution to prevent routes learned from one route source from being advertised into another route source and vice versa. While route maps can be used to match against many different criteria, when redistributing, the most scalable solution is to use route tag for filtering. This is implemented as follows on R2:
| R2(config)#route-map EIGRP-into-OSPF deny 10 R2(config-route-map)#description ‘Deny Routes With A Tag of 3’ R2(config-route-map)#match tag 3 R2(config-route-map)#exit R2(config)#route-map EIGRP-into-OSPF permit 20 R2(config-route-map)#description ‘Tag Routes With A Tag of 2’ R2(config-route-map)#set tag 2 R2(config-route-map)#exit R2(config)#route-map OSPF-into-EIGRP deny 10 R2(config-route-map)#description ‘Deny Routes With A Tag of 3’ R2(config-route-map)#match tag 3 R2(config-route-map)#exit R2(config)#route-map OSPF-into-EIGRP permit 20 R2(config-route-map)#description ‘Tag Routes With A Tag of 2’ R2(config-route-map)#set tag 2 R2(config-route-map)#exit R2(config)#router ospf 2 R2(config-router)#redistribute eigrp 1 subnets route-map EIGRP-into-OSPF R2(config-router)#exit R2(config)#router eigrp 1 R2(config-router)#default-metric 100000 10 255 1 1500 R2(config-router)#redistribute ospf 2 route-map OSPF-into-EIGRP R2(config-router)#exit |
The inverse configuration is then implemented on R3 as follows:
| R3(config)#route-map EIGRP-into-OSPF deny 10 R3(config-route-map)#description ‘Deny Routes With A Tag of 2’ R3(config-route-map)#match tag 2 R3(config-route-map)#exit R3(config)#route-map EIGRP-into-OSPF permit 20 R3(config-route-map)#description ‘Tag Routes With A Tag of 3’ R3(config-route-map)#set tag 3 R3(config-route-map)#exit R3(config)#route-map OSPF-into-EIGRP deny 10 R3(config-route-map)#description ‘Deny Routes With A Tag of 2’ R3(config-route-map)#match tag 2 R3(config-route-map)#exit R3(config)#route-map OSPF-into-EIGRP permit 20 R3(config-route-map)#description ‘Tag Routes With A Tag of 3’ R3(config-route-map)#set tag 3 R3(config-route-map)#exit R3(config)#router ospf 3 R3(config-router)#redistribute eigrp 1 subnets route-map EIGRP-into-OSPF R3(config-router)#exit R3(config)#router eigrp 1 R3(config-router)#default-metric 100000 10 255 1 1500 R3(config-router)#redistribute ospf 3 route-map OSPF-into-EIGRP R3(config-router)#exit |
While this configuration may appear intimidating and confusing at first glance, it is very simple to understand. The following sections describe the logic of the route map configurations:
On R2, the EIGRP-into-OSPF route map performs the following actions:
- The first deny statement denies all routes with a route tag of 3. These are the OSPF routes that are redistributed into EIGRP on R3
- The second permit statement allows all EIGRP routes and assigns an administrator tag value of 2 for those routes during redistribution into OSPF
On R2, the OSPF-into-EIGRP route map performs the following actions:
- The first deny statement denies all routes with a route tag of 3. These are the EIGRP routes that are redistributed into OSPF on R3
- The second permit statement allows all OSPF routes and assigns an administrator tag value of 2 for those routes during redistribution into EIGRP
On R3, the EIGRP-into-OSPF route map performs the following actions:
- The first deny statement denies all routes with a route tag of 2. These are the OSPF routes that are redistributed into EIGRP on R2
- The second permit statement allows all EIGRP routes and assigns an administrator tag value of 3 for those routes during redistribution into OSPF
On R3, the OSPF-into-EIGRP route map performs the following actions:
- The first deny statement denies all routes with a route tag of 2. These are the EIGRP routes that are redistributed into OSPF on R2
- The second permit statement allows all EIGRP routes and assigns an administrator tag value of 3 for those routes during redistribution into OSPF
By preventing EIGRP routes being re-advertised back into the EIGRP domain, R1 will prefer the external EIGRP routes received from its downstream neighbor as the same prefix is not being re-advertised back into EIGRP by either R2 or R3. This prevents routing loops from forming and can be validated by looking at the routing table of R1 which shows the following entries:
| R1#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets C 10.0.9.0 is directly connected, Serial0/0 D EX 10.0.2.0 [170/30720] via 10.0.0.2, 00:02:23, FastEthernet0/0 [170/30720] via 10.0.1.3, 00:02:23, FastEthernet0/1 D EX 10.0.3.0 [170/30720] via 10.0.0.2, 00:02:23, FastEthernet0/0 [170/30720] via 10.0.1.3, 00:02:23, FastEthernet0/1 C 10.0.0.0 is directly connected, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/1 D EX 192.168.254.0/24 [170/18311936] via 10.0.9.5, 00:02:23, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets D EX 192.168.253.0 [170/18311936] via 10.0.9.5, 00:02:23, Serial0/0 |
As a point of interest, it should be noted that using route map filtering with tags does not mean that there will be no suboptimal routing issues in the OSPF domain. For example, R3 continues to prefer the external OSPF route for the 192.168.253.0 and 192.168.254.0 subnets over the external EIGRP routes for the same destinations as can be seen in the routing table of R3 below:
| R3#show ip route | begin Gateway Gateway of last resort is not set10.0.0.0/24 is subnetted, 5 subnets D 10.0.9.0 [90/5514496] via 10.0.1.1, 02:48:48, FastEthernet0/0 O 10.0.2.0 [110/128] via 10.0.3.4, 01:07:41, Serial0/0 C 10.0.3.0 is directly connected, Serial0/0 D 10.0.0.0 [90/30720] via 10.0.1.1, 02:48:48, FastEthernet0/0 C 10.0.1.0 is directly connected, FastEthernet0/0 O E2 192.168.254.0/24 [110/20] via 10.0.3.4, 00:05:31, Serial0/0 192.168.253.0/29 is subnetted, 1 subnets O E2 192.168.253.0 [110/20] via 10.0.3.4, 00:05:31, Serial0/0 |
The simplest way to resolve this issue would be to adjust the default administrative distance for external OSPF routes on R3. However, on the positive side, the routing loop has been averted and R4 is still able to reach either the 192.168.253.0/29 or 192.168.254.0/24 subnets:
| R4#traceroute ip 192.168.253.1Type escape sequence to abort. Tracing the route to 192.168.253.11 R2-Se0-Interface (10.0.2.2) 0 msec 0 msec 0 msec 2 R1-Fa0-Interface (10.0.0.1) 4 msec 0 msec 0 msec 3 R5-Se0-Interface (10.0.9.5) 4 msec * 4 msec R4#ping 192.168.253.1 Type escape sequence to abort. |
| R4#traceroute ip 192.168.254.1Type escape sequence to abort. Tracing the route to 192.168.254.11 R2-Se0-Interface (10.0.2.2) 4 msec 0 msec 0 msec 2 R1-Fa0-Interface (10.0.0.1) 0 msec 0 msec 4 msec 3 R5-Se0-Interface (10.0.9.5) 4 msec * 4 msec R4#ping 192.168.254.1 Type escape sequence to abort. |
In summation, although a lot has been discussed in this chapter, make it a point to remember the following when implementing route redistribution:
- When possible, use a protocol that can use different administrative distance values for internal and external routes. Examples would be BGP, EIGRP and OSPF; but not RIP
- If possible, redistribute external routes with a higher administrative distance value than that of the route source. EIGRP does this automatically, OSPF and BGP do not
- Use route tagging or other filters to ensure that only routes internal to the route source or prefixes that originate from the route source domain are redistributed
- Redistribute external routes with a higher metric (worse) ensuring that if routes are redistributed back into the original domain, they are less preferred
While route redistribution is sometimes the only solution to incorporate routes from one route source into another, e.g. when two companies merge, it is important to understand that you should always consider other alternatives before considering redistribution. For example, assume that a router is configured with the following static routes:
| R1(config)#ip route 150.254.100.0 255.255.255.0 serial 0/0 R1(config)#ip route 150.254.101.0 255.255.255.0 serial 0/0 R1(config)#ip route 150.254.102.0 255.255.255.0 serial 0/0 R1(config)#ip route 150.254.103.0 255.255.255.0 serial 0/0 |
If you are running EIGRP as the IGP of choice, for example, rather than redistribute the static routes into EIGRP, consider using the network statement instead as illustrated below:
| R1(config)#router eigrp 1 R1(config-router)#network 150.254.100.0 0.0.3.255 R1(config-router)#exit |
With this configuration, the static routes are redistributed into EIGRP without having to use the redistributecommand as shown in the EIGRP Topology Table:
| R1#show ip eigrp 1 topology | begin 150.254.100 P 150.254.100.0/24, 1 successors, FD is 5511936 via Rstatic (5511936/0) P 150.254.101.0/24, 1 successors, FD is 5511936 via Rstatic (5511936/0) P 150.254.102.0/24, 1 successors, FD is 5511936 via Rstatic (5511936/0) P 150.254.103.0/24, 1 successors, FD is 5511936 via Rstatic (5511936/0) |
The advantage of using this technique is that the routes are advertised to downstream routers as internal EIGRP routes and not as external routes as illustrated in the following output:
| R2#show ip route eigrp | include 150.254 150.254.0.0/24 is subnetted, 4 subnets D 150.254.100.0 [90/5514496] via 10.0.0.1, 00:05:54, FastEthernet0/0 D 150.254.101.0 [90/5514496] via 10.0.0.1, 00:05:46, FastEthernet0/0 D 150.254.102.0 [90/5514496] via 10.0.0.1, 00:05:39, FastEthernet0/0 D 150.254.103.0 [90/5514496] via 10.0.0.1, 00:05:32, FastEthernet0/0 |
By advertising static routes within the autonomous system as internal routes, you can quickly identify external routes that are imported from dynamic routing protocols, for example. Additionally, it keeps the routing policy within the interior network consistent, i.e. all routes within the interior network are internal routes.
NOTE: In order to use the network statement for static routes, the subnet for the interface via which the routes point should be included in EIGRP network statement configuration.
As another example, assume that a router running OSPF has 50 Loopback interfaces configured. While it is tempting to simply use the redistribute connected subnets command to redistribute the connected interfaces, this configuration will result in the generation 50 Type 5 LSAs which are then flooded to all routers in all areas. Instead, consider using the network command to advertise the subnets and then use the passive-interfacecommand to prevent OSPF packets from being sent on these interfaces. This reduces the size of the LSDB for routers within the area. If possible, the ABR can then be configured to advertise a single summary LSA for the Type 5 routes keeping the OSPF database for routers in other areas lean.
And finally, avoid mutual redistribution where possible and consider implementing one-way redistribution and using a default route for one of the route sources instead of performing mutual redistribution. Consider the network topology illustrated in Figure 4-17 for example:

Fig. 4-17. One-Way Redistribution with a Default Route
Referencing Figure 4-17, instead of configuring mutual redistribution between OSPF and EIGRP on R2 and R3, along with the relevant route maps and administrative distance tweaking, the EIGRP routes could simply be redistributed into OSPF and a default route could be advertised into the EIGRP domain allowing R1 to reach all OSPF subnets as follows:
| R2(config)#router ospf 2 R2(config-router)#redistribute eigrp 1 subnets R2(config-router)#exit R2(config)#interface fastethernet 0/0 R2(config-if)#ip summary-address eigrp 1 0.0.0.0 0.0.0.0 R2(config-if)#exit |
| R3(config)#router ospf 3 R3(config-router)#redistribute eigrp 1 subnets R3(config-router)#exit R3(config)#interface fastethernet 0/0 R3(config-if)#ip summary-address eigrp 1 0.0.0.0 0.0.0.0 R3(config-if)#exit |
Using this configuration, R1 and R4 still have end to end connectivity as illustrated below:
| R1#ping 144.144.144.144 repeat 10 source 192.168.254.1Type escape sequence to abort. Sending 10, 100-byte ICMP Echos to 144.144.144.144, timeout is 2 seconds: Packet sent with a source address of 192.168.254.1 !!!!!!!!!! Success rate is 100 percent (10/10), round-trip min/avg/max = 1/3/4 ms |
You can also perform a Traceroute to verify the path taken to R4 as follows:
| R1#traceroute ip 144.144.144.144Type escape sequence to abort. Tracing the route to 144.144.144.1441 R3-Fa0-Interface (10.0.1.3) 0 msec R2-Fa0-Interface (10.0.0.2) 4 msec R3-Fa0-Interface (10.0.1.3) 0 msec 2 R4-Se0-Interface (10.0.2.4) 0 msec R4-Se1-Interface (10.0.3.4) 0 msec * |