filter-policy export (OSPF view)
Use filter-policy export to configure OSPF to filter redistributed routes.
Use undo filter-policy export to remove the configuration.
Syntax
filter-policy { ipv4-acl-number | prefix-list prefix-list-name } export [ protocol [ process-id ] ]
undo filter-policy export [ protocol [ process-id ] ]
Default
OSPF does not filter redistributed routes.
Views
OSPF view
Predefined user roles
network-admin
Parameters
ipv4-acl-number: Specifies an IPv4 ACL by its number in the range of 2000 to 3999 to filter redistributed routes by destination address.
prefix-list-name: Specifies an IP prefix list by its name, a case-sensitive string of 1 to 63 characters, to filter redistributed routes by destination address.
protocol: Filters routes redistributed from the specified routing protocol. If you do not specify this argument, the command filters all redistributed routes.
process-id: Specifies a process by its ID in the range of 1 to 65535. This argument is available only when the protocol argument is rip, ospf, or isis.
Usage guidelines
To use an advanced ACL (with a number from 3000 to 3999) in the command, configure the ACL using one of the following methods:
To deny/permit a route with the specified destination, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.
To deny/permit a route with the specified destination and mask, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.
The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination address. For the mask configuration to take effect, specify a contiguous subnet mask.
Examples
# Configure OSPF process 100 to filter redistributed routes by using basic ACL 2000.
<Sysname> system-view [Sysname] acl basic 2000 [Sysname-acl-ipv4-basic-2000] rule deny source 192.168.10.0 0.0.0.255 [Sysname-acl-ipv4-basic-2000] quit [Sysname] ospf 100 [Sysname-ospf-100] filter-policy 2000 export
# Configure advanced ACL 3000 to permit only route 113.0.0.0/16. Configure OSPF process 100 to filter redistributed routes by using advanced ACL 3000.
<Sysname> system-view [Sysname] acl advanced 3000 [Sysname-acl-ipv4-adv-3000] rule 10 permit ip source 113.0.0.0 0 destination 255.255.0.0 0 [Sysname-acl-ipv4-adv-3000] rule 100 deny ip [Sysname-acl-ipv4-adv-3000] quit [Sysname] ospf 100 [Sysname-ospf-100] filter-policy 3000 export
Related commands
import-route