Route redistribution (suboptimal)

OSPF EIGRP Redistribution

I have an issue with redistribution route on R4 and R5.

By default configuration a route to is redistributed from EIGRP to OSPF and then back to EIGRP (because of AD (D EX 170 > O E2 110)).

This cause suboptimal routing.

To prevent this we can use:

- decrease AD for EIGRP external route;

- filter route via distribute-list;

- set tag on O E2 routes and filter them.

I use the last solution.

But strange behavior occured. It works only on one router per time (R4 or R5):

  1. R4#sh ip route eigrp  
  2. ...  
  3. is variably subnetted, 3 subnets, 2 masks  
  4. D [90/307200] via, 00:35:04, Ethernet0/1  


  1. R5#sh ip route eigrp  
  2. ...  
  3. is variably subnetted, 6 subnets, 2 masks  
  4. D EX [170/409600] via, 00:22:22, Ethernet0/1  
  5. is variably subnetted, 3 subnets, 2 masks  
  6. D [90/307200] via, 01:03:00, Ethernet0/1  


Next we clear ospf and eigrp process on R4 and:


  1. R4#sh ip route eigrp  
  2. ...  
  3. is variably subnetted, 6 subnets, 2 masks  
  4. D EX [170/409600] via, 00:00:06, Ethernet0/1  
  5. is variably subnetted, 3 subnets, 2 masks  
  6. D [90/307200] via, 00:00:23, Ethernet0/1  


  1. R5#sh ip route eigrp  
  2. ...  
  3. is variably subnetted, 3 subnets, 2 masks  
  4. D [90/307200] via, 01:08:48, Ethernet0/1  


  1. Here is configs:  
  2. R4:  
  3. interface Ethernet0/0  
  4.  ip address  
  5. !  
  6. interface Ethernet0/1  
  7.  ip address  
  8. !  
  9. ...  
  10. router eigrp 10  
  11.  network  
  12.  redistribute ospf 1 metric 10000 100 255 1 1500 route-map Redistr_OSPF_to_EIGRP  
  13.  passive-interface default  
  14.  no passive-interface Ethernet0/1  
  15.  eigrp router-id  
  16. !  
  17. router ospf 1  
  18.  router-id  
  19.  redistribute eigrp 10 subnets route-map Redistr_EIGRP_to_OSPF  
  20.  passive-interface default  
  21.  no passive-interface Ethernet0/0  
  22.  network area 1  
  23. !  
  24. ip forward-protocol nd  
  25. !  
  26. !  
  27. no ip http server  
  28. no ip http secure-server  
  29. !  
  30. ip access-list standard TAG_10.1.6.0/24  
  31.  permit  
  32. !  
  33. !  

  1. route-map Redistr_EIGRP_to_OSPF permit 10  
  2.  match ip address TAG_10.1.6.0/24  
  3.  set tag 20  
  4. !  
  5. route-map Redistr_EIGRP_to_OSPF permit 20  
  6. !  
  7. route-map Redistr_OSPF_to_EIGRP deny 10  
  8.  match tag 10  
  9. !  
  10. route-map Redistr_OSPF_to_EIGRP permit 20  
  11. ...  



  1. interface Ethernet0/0  
  2.  ip address  
  3. !  
  4. interface Ethernet0/1  
  5.  ip address  
  6. ...  
  7. router eigrp 10  
  8.  network  
  9.  redistribute ospf 1 metric 10000 100 255 1 1500 route-map Redistr_OSPF_to_EIGRP  
  10.  passive-interface default  
  11.  no passive-interface Ethernet0/1  
  12.  eigrp router-id  
  13. !  
  14. router ospf 1  
  15.  router-id  
  16.  redistribute eigrp 10 subnets route-map Redistr_EIGRP_to_OSPF  
  17.  passive-interface default  
  18.  no passive-interface Ethernet0/0  
  19.  network area 1  
  20. !  
  21. ip forward-protocol nd  
  22. !  
  23. !  
  24. no ip http server  
  25. no ip http secure-server  
  26. !  
  27. !  
  28. ip prefix-list TAG_10.1.6.0/24 seq 5 permit  
  29. !  

  1. route-map Redistr_EIGRP_to_OSPF permit 10  
  2.  match ip address prefix-list TAG_10.1.6.0/24  
  3.  set tag 10  
  4. !  
  5. route-map Redistr_EIGRP_to_OSPF permit 20  
  6. !  
  7. route-map Redistr_OSPF_to_EIGRP deny 10  
  8.  match tag 20  
  9. !  
  10. route-map Redistr_OSPF_to_EIGRP permit 20  
  11. ...  


  • Your tag is denied from redistributed back into EIGRP for loop prevention, but not from getting installed into the RIB by OSPF.

    If you want to filter the suboptimal routing you also need to filter it out the routing table to select the  EIGRP route (170) over OSPF (110).

  • But why on R5 EIGRP route is installed in RIB, and on R4 - the same route is installed as OSPF? 

    And if we clear OSPF and EIGRP process on R4 - he got via EIGRP, and R5 via OSPF?

    And if we clear OSPF and EIGRP process on R5 - he got via EIGRP, and R4 via OSPF?

  • This is because of the order of operation:

    The network will get installed in R4 and R5 by EIGRP. (D EX / 170)
    The routes will get redistributed into OSPF.
    The route will arrive by R4 or R5 first (depending on the order of operation)
    The router that first receives the redistributed route will install the route as OSPF (O E2 / 110)

  • I still can't understand.

    The route via R4 is tagged and redistributed into OSPF domain. Then it arrives to R5 (as O E2) - tag is matched and route is filtered out. And vise versa.


  • With redistribute route-map you are filtering what is getting redistributed.

    So you are not allowing the tagged routes from getting redistributed back into EIGRP again. The redistribute route-map does not filtering the route from the routing table. 

    For the suboptimal routing you have to filter the suboptimal process from getting into the routing table with for example an distirbute list.

  • Your filtering is done at the redistribution level, not at the RIB/database level of each protocol. Thus, it is expected that one router will prefer the EIGRP path (the one that first redistributes EIGRP into OSPF) anf the other router will prefer the OSPF path (as it receives the same prefix as D EX and O E, and the OSPF AD of 110 beats EIGRP EX of 170). You cannot make both routers prefer the OSPF path, since the prefix is inthe EIGRP domain, that would be a loop. What you did, is one router prefer the EIGRP path and one the OSPF path; you can make both prefer the EIGRP path, and if you choose filtering as a solution, you need to make an inbound filter into OSPF via distribute-list.

  • Ok i understand that filtering is on LSDB level, not RIB (route table).

    But routes are injected in RIB based on AD and router protocol database.

    Via route-map we are filtered LSA5 for tagged routes.

    I see this picture:

    - if R4 have a route to via eigrp, then R5 have R4 LSA5 for this network in LSDB (and as expected choose O E2)

    - R4 has its own LSA5 for (not R5 LSA5 as it's filtered via route map (deny tag 10) and as expected choose D EX)

    Question - why R4 LSA5 (tagged 20) not filtered on R5 as it came from OSPF domain?

  • Hi,

      It is being filtered, but from being advertised back into EIGRP, cause filtering is done at the redistribution level; when you redistribute from A to B, you take routes installed by A into RIB and connected interfaces/routes on which A runs and out those into B's database/topology.



  • Thanks, guys. I got it.

    "the early bird catches the worm"

    R6 ---D EX---> R4 (get to RIB as D EX) ---O E2---> R2 ---O E2---> R1 ---O E2 ---> R3 ---O E2 ---> R5 (get ro RIB as O E2) ---X (as tag route filtered for redistribution back to EIGRP domain)

    or vice versa if R5 first establish neighborship with R6

Sign In or Register to comment.