filtering routes to ospf neighbor

Unanswered Question
Nov 3rd, 2008
User Badges:

Hi guys,

I want to filter few routes to be announced to only one neighbor in an OSPF area with 40 routers, is it possible to avoid affecting the other neighbors.



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
francisco_1 Mon, 11/03/2008 - 05:57
User Badges:
  • Gold, 750 points or more

as far as i know i dont think you can filter routes within an area since all routers within the same area should have the same LSDB used when building SPF. But you can filter inbound routes from another area if that's what you want using policy map. you can define a route map to prevent OSPF routes from being added to the routing table.

see this


tim.blombery Mon, 11/03/2008 - 07:22
User Badges:

You can't filter LSAs (route-advertisements) within a Link State protocol. Other than running a separate AS as suggested above, the only other solution is to apply a distribute-list inbound on every router you don't want to receive a particular route. The LSA is still in the LSDB, and is still flooded to all neighbors, but is not installed into the routing table.

Giuseppe Larosa Mon, 11/03/2008 - 09:37
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Francisco and Mustapha,

the better command for inter-area filtering is:

area x filter-list prefix-list in|out


the constraints are:

no external routes can be filtered only internal O and O IA routes.

So for example avoid to use redistribute connected use network area command + passive-interface on all routers to avoid to inject external routes in the OSPF domain.

if the router that has to receive a subset of OSPF routes can be placed in a stub area all the external routes are filtered for the nature of the Area and the previous constraint is removed.

A NSSA area could be used also if the second router has to inject external routes in the OSPF domain.

So the router should be placed in another area.

However, if the router is only one and no other nodes are behind it, a

distribute-list in

can be used on that router : it is an approximate solution the LSAs are not filtered just the corresponding subnets are not installed in the routing table but it is the easier change.

Hope to help


tcordier Mon, 11/03/2008 - 07:37
User Badges:
  • Bronze, 100 points or more

I agree with the two earlier posts. Options available to you are using a) either a different OSPF process between the two peers in question, and red-distribute between processes (if needed), or b) another IGP altogether and redistribute if needed. The latter option is in my view preferable as you have an easier way of recognizing routes when troubleshooting.

HTH, Thomas


This Discussion