Users can define a route map to prevent OSPF routes from being added to the routing table. This filtering happens at the
moment when OSPF is installing the route in the routing table. This feature has no effect on link-state advertisement (LSA)
flooding. In the route map, the user can match on any attribute of the OSPF route. That is, the route map could be based on
This feature can be useful during redistribution if the user tags prefixes when they get redistributed on Autonomous System
Boundary Routers (ASBRs) and later uses the tag to filter the prefixes from being installed in the routing table on other
Filtering Based on Route Tag
Users can assign tags to external routes when they are redistributed to OSPF. Then the user can deny or permit those routes
in the OSPF domain by identifying that tag in the
Filtering Based on Route Type
In OSPF, the external routes could be Type 1 or Type 2. Users can create route maps to match either Type 1 or Type 2 and
then use the
in command to filter certain prefixes. Also, route maps can identify internal routes (interarea and intra-area) and then those
routes can be filtered.
Filtering Based on Route Source
When a match is done on the route source, the route source represents the OSPF Router ID of the LSA originator of the LSA
in which the prefix is advertised.
Filtering Based on Interface
When a match is done on the interface, the interface represents the outgoing interface for the route that OSPF is trying
to install in the routing table.
Filtering Based on Next Hop
When a match is done on the next hop, the next hop represents the next hop for the route that OSPF is trying to install in
the routing table.
in command can be configured to prevent routes from being installed in the global Routing Information Base (RIB). Prior to the
implementation of OSPF local RIB (for feature information on OSPF local RIB, see OSPFv2 Local RIB), OSPF would attempt to
install a less preferred route (e.g. an inter-area route when the intra-area path is filtered). With OSPF local RIB, only
the best route is considered (because this is the only route the local RIB maintains). There is no concept of a "second-best"
OSPF route. For more information on the routing algorithm used by Cisco OSPF routers, please refer to RFC 2328.