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 are not filtered.
filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name | route-policy route-policy-name } export [ protocol [ process-id ] ]
undo filter-policy [ acl-number | acl-name acl-name | ip-prefix ip-prefix-name | route-policy route-policy-name ] export [ protocol [ process-id ] ]
Parameter | Description | Value |
---|---|---|
acl-number |
Specifies the number of a basic ACL. |
The value is an integer that ranges from 2000 to 2999. |
acl-name acl-name |
Specifies the name of a named ACL. |
The value is a string of 1 to 64 case-sensitive characters without spaces. The value must start with a letter. |
ip-prefix ip-prefix-name |
Specifies the name of an IP prefix list. |
The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
route-policy route-policy-name |
Specifies the name of a routing policy. |
The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
protocol process-id |
Filters imported routes of a specified protocol. The value can be direct, rip, isis, bgp, ospf, unr, or static. When the routing protocol is RIP, IS-IS, or OSPF, you can specify a process ID. |
The value is an integer that ranges from 1 to 65535. The default value 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 or process-id parameter can be specified to determine a specified protocol or process. If the protocol or process-id parameter is not specified, OSPF filters all imported routes.
Precautions
This command can be configured only on ASBRs because AS-external-LSAs are generated by ASBRs.
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 an IP prefix list or route-policy before it is referenced is recommended. By default, nonexistent IP prefix lists or 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 IP prefix list or 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.