LSA Filter Overview

Route filtering in OSPF works differently than EIGRP/RIP, etc. The distribute-list and prefix-list in OSPF do not filter LSAs that are sent and received between routers.

There is also a way to filter LSAs. There are two types of LSAs that can be filtered

  • LSA Type3
  • LSA Type5(LSA Type7)

LSA type 3 is an LSA that represents a network address/subnet mask that exists in another area for an area. Also, LSA type 5 and LSA type 7 are LSAs that represent network addresses/subnet masks that exist outside the OSPF domain. Each LSA has a specific router that generates it: LSA type 3 is generated by the Area Border Router (ABR); LSA types 5 and 7 are generated by the Autonomous System Boundary Router (ASBR).

Each LSA can be filtered by the router that generates it. In other words, ABR can filter LSA type 3. Also, LSA type 5 and LSA type 7 can be filtered by ASBR. To filter LSA type 3, use the area filter-list command in ABR. Also, to filter LSA type 5 and LSA type 7, use the distribute-list out command in the ASBR.


Configuring LSA Type 3 Filters

To filter LSA type 3 in OSPF, use the area filter-list command in ABR. The syntax of the area filter-list command is as follows.

LSA Type 3 Filter

(config)#router ospf ‹process-id›
(config-router)#area ‹area-id› filter-list prefix ‹prefix-list-name› {in|out}

‹process-id›: OSPF process ID
‹area-id›: area ID
‹prefix-list-name›: Prefix-list name

The LSA type 3 contains the network address/subnet mask. The prefix list specifies the network address/subnet mask to permit/deny. In addition, there are in and out to specify the direction.

in filters when generating LSA type 3 in the LSDB of the specified area from the LSDB of another area. On the other hand, out filters when LSA type 3 is generated from the LSDB of the specified area into the LSDB of another area. The following figure illustrates how to specify the direction of the area filter-list.

Figure area filter-list prefix in
Figure area filter-list prefix in
Figure area filter-list prefix out
Figure area filter-list prefix out

To verify in which direction the area filter-list command was configured for which area, use the show ip ospf command. Also, to verify the prefix list is the show ip prefix-list command. And to verify whether the LSA type 3 in the LSDB is actually filtered or not, use the show ip ospf database command.

Configuring LSA Type 5 Filters

LSA type 5 can be filtered when redistributing to OSPF from other routing processes on ASBR. In other words, the LSA type 5 filter assumes OSPF redistribution. Also, there are two configurations for LSA type 5 filters: one that uses the distribute-list/prefix-list, and one that uses the route map.

For NSSA, the filter is an LSA type 7 filter. The concept is the same as for the LSA type 5 filter.

Filter by distribute-list/prefix-list

The configuration of the filter for LSA type 5 when using the distribute-list/prefix-list is as follows

LSA Type5 filter by distribute-list/prefix-list

(config-router)#redistribute ‹protocol› subnets
(config-router)#distribute-list [prefix] {<ACL>|<prefix-list-name>} out ‹protocol›

‹process-id›:OSPFプロセスID
‹protocol›: Routing process of redistribution source
‹ACL›: ACL number
‹prefix-list-name›: prefix-list name

Identify the LSA type 5 to be generated by the ASBR by means of standard access list or prefix list. Note that the application of a standard access list or a prefix list is out direction. After “out”, specify the same redistribute source routing process as the one specified in redistribute command.

Filter by route-map

The configuration of the filter for LSA type 5 when using route maps is as follows

LSA Type5 filter by route-map

(config)#router ospf ‹process-id›
(config-router)#redistribute ‹protocol› subnets route-map ‹route-map-name›

‹process-id›: OSPF process ID
‹protocol›: Routing process of redistribution source
‹route-map-name›:route-map name

The route map identifies the LSA type 5 to be generated by the ASBR. The route map is applied as an option of the redistribute command. With route-map, you can do filter + alpha: you can not only simply filter LSA type 5, but also change the metric type and metric, and add a route tag.

How the OSPF works