By applying filters of routing policies to routing protocols, you can filter routes to be advertised.
To enable a device to advertise required routes, define the filter (such as the IP prefix list, ACL, or route-policy) for a routing policy, apply the filter to routing protocols, and run the filter-policy command specified with the filter in the related protocol view to filter the routes to be advertised.
The function of the filter-policy export 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 the routes to be advertised to neighbors.
Link-state protocol
A link-state protocol generates routes based on the LSDB. The filter-policy command does not affect any Link State Advertisement (LSA) or LSDB.
When advertising routes, you can run the filter-policy export command to determine whether to advertise the imported routes (such as the imported RIP routes). Only the LSAs or Link State PDUs (LSPs) that are imported using the filter-policy import command are added to the LSDB. This does not affect the LSAs advertised to other routers.
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.