filter-policy import (OSPF view)

Function

The filter-policy import command configures a filtering policy to filter the 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 import

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

undo filter-policy [ acl-number | acl-name acl-name | ip-prefix ip-prefix-name | { route-policy route-policy-name | route-filter route-filter-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 basic ACL.

The value is a string of 1 to 64 case-sensitive characters without spaces. The value must start with a letter (a to z or A to Z, case sensitive).

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 route-policy.

The name is a string of 1 to 200 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

route-filter route-filter-name

Specifies the name of route filter policy.

The value is a string of 1 to 200 case-sensitive characters, spaces not supported. If parameters are included in the referenced route-filter, specify values for them in the format of (var1, var2, ...var8) behind the route-filter name. A maximum of eight parameters can be specified, and each value ranges from 1 to 200 characters.

secondary

Indicates the secondary route.

-

Views

OSPF view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
ospf write

Usage Guidelines

Usage Scenario

After the filter-policy import command is run, only the routes that pass the filtering can be added to the routing information base (RIB) and advertised. Therefore, the device does not advertise Summary-LSAs, AS-External-LSAs, or NSSA LSAs to other areas or processes. OSPF is a link-state dynamic routing protocol, with routing information carried in link status advertisements (LSAs). Therefore, the filter-policy import command cannot be used to filter the advertised or received LSAs. This command is used to filter the routes calculated by OSPF, and only the matched routes can be added to the RIB.

Precautions

When the rule command is used to configure a filtering rule for a named ACL, only the source address range that is specified in source and the time period that is specified in time-range take effect on the filtering rule.

Example

# Configure OSPF to filter the received routes.
<HUAWEI> system-view
[~HUAWEI] ip ip-prefix prefix1 deny 1.1.1.1 24
[*HUAWEI] ospf 100
[*HUAWEI-ospf-100] filter-policy ip-prefix prefix1 import
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >