The filter-policy export command filters the imported routes when these routes are advertised based on a filtering policy.
The undo filter-policy export command restores the default setting.
By default, the imported routes to be advertised cannot be filtered.
filter-policy { acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name } export [ direct | static | unr | bgp | { rip | isis | ospf } [ process-id ] ]
undo filter-policy [ acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name ] export [ direct | static | unr | bgp | { rip | isis | ospf } [ process-id ] ]
| Parameter | Description | Value |
|---|---|---|
acl-number |
Specifies the basic ACL number. |
The value is an integer that ranges from 2000 to 2999. |
ip-prefix ip-prefix-name |
Specifies the name of the address prefix list. |
The value must be the name of an existing address prefix list. |
route-policy route-policy-name |
Specifies the name of the routing policy. |
The value must be the name of an existing routing policy. |
direct |
Specifies direct routes. |
- |
static |
Specifies static routes. |
- |
unr |
Specifies UNR routes. |
- |
bgp |
Specifies BGP routes. |
- |
rip |
Specifies RIP routes. |
- |
isis |
Specifies IS-IS routes. |
- |
ospf |
Specifies OSPF routes. |
- |
process-id |
Specifies the process ID. |
The value is an integer ranging from 1 to 65535. By default, it is 1. |
Usage Scenario
After OSPF imports external routes using the import-route command, you can use the filter-policy export command to filter the imported routes to be advertised. Only the external routes that pass the filtering can be converted into AS-external LSAs and advertised.
The protocol and process-id parameter can be specified to determine a specified protocol or process. If the protocol and process-id parameter is not specified, OSPF filters all imported routes.
Precautions
Creating an ACL before it is referenced is recommended. If a nonexistent ACL is referenced using the command, all external routes imported to OSPF are converted to Type 5 LSAs (AS-external-LSAs) or Type 7 LSAs (NSSA-external-LSAs) and then are advertised to neighbors.
Creating a route-policy before it is referenced is recommended. By default, nonexistent route-policies cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command, all external routes imported to OSPF are converted to Type 5 LSAs (AS-external-LSAs) or Type 7 LSAs (NSSA-external-LSAs) and then are advertised to neighbors.