By applying filters of routing policies to routing protocols, you can filter the received routes.
When exchanging routes on a network, devices need to accept only required routes. In this situation, you can define a filter (such as an IP prefix list, ACL, or a route-policy) for a routing policy, apply the filter to the routing protocol, and run the filter-policy command specified with the filter in the related protocol view to filter received routes. Then, devices accept only the routes that meet the matching rules.
The function of the filter-policy import command varies the protocol type. And the functions to a distance-vector protocol and a link-state protocol are as follows:
Distance-vector protocol
A distance-vector protocol generates routes based on the routing table. Therefore, the command filters the routes received from neighbors and those to be advertised to neighbors.
Link-state protocol
A link-state protocol generates routes based on the link state database (LSDB). The filter-policy command does not affect any Link State Advertisement (LSA) or LSDB.
After routes are received, the filter-policy command determines which routes to be added from the protocol routing table to the local core routing table. Therefore, this command takes effect on the local core routing table rather than the protocol routing table.
BGP has the powerful filtering function. For the configuration of BGP routing policies, refer to "BGP Configuration."
For details of the filter-policy and import-route commands and their applications in RIP, OSPF, IS-IS, and BGP, refer to related configurations.