
OSPF Route Filtering
explains how OSPF routes can be filtered on a router.
- Route filtering is a method for selectively identifying routes that are advertised or received from neighbor routers.
- Route filtering may be used to manipulate traffic flows, reduce memory utilization, or improve security.
- Filtering of routes with vector-based routing protocols is straightforward as the routes are filtered as routing updates are advertised to downstream neighbors.
- With link-state routing protocols such as OSPF, every router in an area shares a complete copy of the linkstate database. Therefore, filtering of routes generally occurs as routes enter the area on the ABR.
Filtering with Summarization
One of the easiest methodologies for filtering routes is to use the not-advertise keyword during prefix summarization. This prevents creation of any type 3 LSAs for any networks in that range, thus making the subordinate routes visible only within the area where the route originates. The full command structure is area area-id range network subnet-mask not-advertise under the OSPF process. In the configuration in 9-11 we see that R2 can filter out any of the type 1 LSAs that are generated in Area 12 from being advertised into Area 0.
Example 9-12 shows R3’s routing table after the area filtering configuration has been placed on R2.
Area Filtering
Although filtering via summarization is very easy, it is limited in its ability. For example, in Figure 9-22, if the 172.16.1.0/24 network needs to be present in Area 0 but removed in Area 34, it is not possible to filter the route using summarization.
Other network designs require filtering of OSPF routes based on other criteria. OSPF supports filtering when type 3 LSA generation occurs, allowing for the original route to be installed in the LSDB for the source area so that the route can be installed in the RIB of the ABR. Filtering can occur in either direction on the ABR. Figure 9-23 demonstrates the concept.
OSPF area filtering is accomplished by using the command area area-id filter-list prefix prefix-list-name {in | out} on the ABR.
Local OSPF Filtering
In some scenarios, routes need to be removed only on specific routers in an area. OSPF is a link-state protocol that requires all routers in the same area to maintain an identical copy of the LSDB for that area. A route can exist in the OSPF LSDB, but it could be prevented from being installed in the local RIB. This is accomplished by using a Distribute List.
Configuring the OSPF Distribute List
A distribute list is configured under the OSPF process with the command distribute-list {acl-number | acl-name | prefix prefix-list-name | route-map route-map-name} in.
Example 9-16 shows the routing tables for R2 and R3. The 172.16.3.0/24 network is removed from R2’s RIB but is present on R3’s RIB. Other useful information: