Pages

Showing posts with label Redistribution. Show all posts
Showing posts with label Redistribution. Show all posts

Saturday, January 29, 2011

Routing Loop (Redistribution)


Routing loop might occur when doing mutual redistribution between routing protocols. Therefore, to help prevent the routing loop, we need to filter routes from being learned by its neighbors. Route-map is the most powerful tools we can use to accomplish this preventing routes redistribute back to the original domain.

Example.
We need to filter route from redistribute back to the original domain eg., preventing EIGRP route from being redistribute back to EIGRP domain from OSPF and RIP. In this scenario. we will use route-map to do this.

To order to fully prevent the route redistribution back which may cause the loop, we require to configure route-map for all routing domain and all direction. See Configuration below.

Configuration


 R1
// deny OSPF learned route redistributed back to OSPF
route-map EIGRP->OSPF deny 10
 match tag 300


// Allow RIP learned route redistributed to OSPF
route-map EIGRP->OSPF permit 20
 match tag 100

// Allow the rest of routes (EIGRP) redistributed to OSPF and set tag 200
route-map EIGRP->OSPF permit 30
 set tag 200


**************


// deny EIGRP learned route redistributed back to EIGRP
route-map OSPF->EIGRP deny 10
 match tag 200

// Allow RIP learned route redistributed to EIGRP
route-map OSPF->EIGRP permit 20
 match tag 100

// Allow the rest of routes (OSPF) redistributed to EIGRP and set tag 300
route-map OSPF->EIGRP permit 30
 set tag 300
!

Redistribution
router eigrp 1
 redistribute ospf 1 metric 1000 10 255 1 1500 route-map OSPF->EIGRP
 auto-summary
!
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets route-map EIGRP->OSPF



R2
route-map EIGRP->RIP deny 10
 match tag 100
route-map EIGRP->RIP permit 20
 match tag 300
route-map EIGRP->RIP permit 30
 set tag 200

route-map RIP->EIGRP deny 10
 match tag 200
route-map RIP->EIGRP permit 20
 match tag 300
route-map RIP->EIGRP permit 30
 set tag 100

Redistribution
router eigrp 1
 redistribute rip metric 1000 10 255 1 1500 route-map RIP->EIGRP
 auto-summary
!
router rip
 version 2
 redistribute eigrp 1 subnets route-map EIGRP->RIP

 R1
route-map EIGRP->OSPF deny 10
 match tag 300
route-map EIGRP->OSPF permit 20
 match tag 100
route-map EIGRP->OSPF permit 30
 set tag 200

route-map OSPF->EIGRP deny 10
 match tag 200
route-map OSPF->EIGRP permit 20
 match tag 100
route-map OSPF->EIGRP permit 30
 set tag 300
!

Redistribution
router eigrp 1
 redistribute ospf 1 metric 1000 10 255 1 1500 route-map OSPF->EIGRP
 auto-summary
!
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets route-map EIGRP->OSPF



R3
route-map OSPF->RIP deny 10
 match tag 100
route-map OSPF->RIP permit 20
 match tag 200
route-map OSPF->RIP permit 30
 set tag 300

route-map RIP->OSPF deny 10
 match tag 300
route-map RIP->OSPF permit 20
 match tag 200
route-map RIP->OSPF permit 30
 set tag 100

Redistribution
router ospf 1
 redistribute rip subnets route-map RIP->OSPF
 auto-summary
!
router rip
 redistribute ospf 1 metric 3 route-map OSPF-RIP


Note from IPExpect (Redistribution)

Note about Problem in Redistribution

  • When redistribution OSPF in to BGP, by default, BGP only accepts internal routes not external type 1 or type 3
  • Beware of the metric used by RIP
  • Watch for the administrative distance prolems especially since IGRP has a lower distance than OSPF
  • Redistributing in to RIP require a metric or default-metric or it may get set to 16
  • Always filter routes when doing redistribution

When Redistributing from on protocol to another 
  • Each protocol has its own rules
  • The path redistributed must be RIB best path
  • The path redistributed must be in the routing table
  • Connected routes always win.
  • Results may or may not be expected

Metric
  • You must set metric in RIP
  • You must set metric in EIGRP except for Connected, Static to interface
  • OSPF metric is 20 (for BGP is 1 )
  • BGP has no metric, but origin is incomplete.

Redistribution Oddities
  • Route map configuration allows.
  • match ip address 
  • match ip next-hop
  • match interface ( of IP next hop)
  • and others
  • Conditional redistribution can occur.
  • Redistribute from RIP to OSPF only if the next hop is 'x' (where /x/ may be the less-preffered RIP path)