< Home

filter-policy export (OSPF)

Function

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 cannot be filtered.

Format

filter-policy { acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name } export [ direct | static | unr | bgp | { rip | isis | ospf } [ process-id ] ]

undo filter-policy [ acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name ] export [ direct | static | unr | bgp | { rip | isis | ospf } [ process-id ] ]

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.

direct

Specifies direct routes.

-

static

Specifies static routes.

-

unr

Specifies UNR routes.

-

bgp

Specifies BGP routes.

-

rip

Specifies RIP routes.

-

isis

Specifies IS-IS routes.

-

ospf

Specifies OSPF routes.

-

process-id

Specifies the process ID.

The value is an integer ranging from 1 to 65535. By default, it is 1.

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

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 and process-id parameter can be specified to determine a specified protocol or process. If the protocol and process-id parameter is not specified, OSPF filters all imported routes.

Precautions

  • This command can be configured only on the ASBR because AS-external-LSAs are generated by an ASBR.
  • For a named ACL, configure a filtering rule, the filtering rule takes effective 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 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 a route-policy before it is referenced is recommended. By default, nonexistent 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 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.

Example

# Filter the routes that are imported from RIP and advertised by OSPF based on a filtering policy.

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