< 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 restores the default setting.

By default, OSPF does not filter routes.

Format

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

undo filter-policy [ acl-number | 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 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.
secondary Select 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 or advertised.

OSPF is a dynamic routing protocol based on the link state, and routing information is carried in LSAs. The filter-policy import command cannot be used to filter the advertised and received LSAs. Actually, this command is used to filter the routes calculated by OSPF. Only the routes that meet the filtering conditions are added to the routing table.

Precautions

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 the received routes.

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