< Home

filter-policy import (OSPF)

Function

The filter-policy import command configures a filtering policy to filter routes received by OSPF.

The undo filter-policy import command restores the default setting.

By default, OSPF does not filter received routes.

Format

filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name | route-policy route-policy-name [ secondary ] } import

undo filter-policy [ acl-number | acl-name acl-name | ip-prefix ip-prefix-name | route-policy route-policy-name [ secondary ] ] import

Parameters

Parameter Description Value
acl-number Specifies the basic ACL number. The value is an integer ranging 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 address 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 the route 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.
secondary Selects a secondary route. -

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The filter-policy import command is used to set a filtering policy for received routes. Only the routes that pass the filtering can be added to the routing table. The routes that fail to pass the filtering cannot be added to the routing table but can be advertised.

The OSPF routing information is recorded in the LSDB. Instead of filtering the received or sent LSAs, the device filters routes calculated by OSPF using the filter-policy import command.

Precautions

For an ACL configured using the acl command, when the rule command is used to configure a filtering rule, the filtering rule takes effect only when the source address range is specified by the source parameter and the time period is specified by the time-range parameter.

Creating an ACL before it is referenced is recommended. If a nonexistent ACL is referenced using the command, all routes received by OSPF are delivered to the IP routing table.

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 routes received by OSPF are delivered to the IP routing table.

Example

# Configure OSPF to filter received routes.

<HUAWEI> system-view
[HUAWEI] ospf 100
[HUAWEI-ospf-100] filter-policy 2000 import
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >