Friday, January 11, 2008

How to filter OSPF routes that have the same source ip

OSPF running on a full-mesh P2MP topology between R3,R4,R5.

Trying to find the route of a network which is equally announced from both R3 & R4 to R5, produces the following:


R5#sh ip route 100.1.34.0
Routing entry for 100.1.34.0/24
Known via "ospf 1", distance 110, metric 74, type intra area
Last update from 100.1.0.4 on Serial1/0, 00:00:46 ago
Routing Descriptor Blocks:
100.1.0.4, from 200.1.4.4, 00:00:46 ago, via Serial1/0
Route metric is 74, traffic share count is 1
* 100.1.0.3, from 200.1.4.4, 00:00:46 ago, via Serial1/0
Route metric is 74, traffic share count is 1


As you can see, 200.1.4.4 is the router-id of the router which announces both routes, but each one with its own next-hop. Probably you're expecting "100.1.0.3, from 200.1.3.3" on the 2nd route, but in OSPF P2MP topologies, the hub router announces the OSPF routes to the spokes using its own ip.

If you want to prevent this route, when originated specifically from R3, from entering the routing table, you must use a route-map and match on the next-hop address of R3. You cannot match on the source ip, because both routes have the same (due to OSPF P2MP network type).



R5(config-route-map)#match ip ?
address Match address of route or match packet
next-hop Match next-hop address of route
route-source Match advertising source address of route



router ospf 1
distribute-list route-map ROUTE_FROM_R3 in
!
access-list 3 permit 100.1.0.3
!
access-list 34 permit 100.1.34.0
!
route-map ROUTE_FROM_R3 deny 10
match ip address 34
match ip next-hop 3
!
route-map ROUTE_FROM_R3 permit 20

No comments:

Post a Comment

 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Greece License.