Wednesday, October 12, 2011

Redistribution: When adding routes removes routes

Yesterday's comparison of IOS and NX-OS redistribution got me thinking about an IOS-specific redistribution gotcha.  It's one that makes the NX-OS logic look a lot more sensible than the IOS logic that we're accustomed to.

Let's say we're using the same network as yesterday, and redistributing from EIGRP to OSPF:
Redistributing EIGRP -> OSPF
Because R2 is an IOS router, it is sending EIGRP routes (Subnet A) and its connected interfaces running EIGRP (Subnet B and S) into OSPF.  R3 has a route to every segment except R2's loopback interface, which isn't running any routing protocol.
So, let's add redistribution for Subnet L on R2:

route-map Connected->OSPF permit 10
 match interface Loopback 0
route-map Connected->OSPF deny 20

router ospf 1
 redistribute connected subnets route-map Connected->OSPF

What happened?  R3 had three OSPF routes, now it only has two!

Subnet L was introduced to OSPF correctly, but the redistribute connected statement has overridden redistribution of Subnet S and Subnet B, so they've been withdrawn.

As "connected interfaces running EIGRP",  subnets S and B had been introduced to OSPF by the redistribution of EIGRP, but our new redistribution directive (connected interfaces, but only if they're Loopback 0) has trumped redistribute eigrp's claim on them.  They're now withdrawn from OSPF.  Bummer.

No comments:

Post a Comment