filter-policy (BGP view)

Function

The filter-policy export command configures a device to use an export policy to filter the routes to be advertised so that only the routes that match the export policy are advertised.

The undo filter-policy export command restores the default configuration.

The filter-policy import command configures a device to filter received routes.

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

By default, received routes or the routes to be advertised are not filtered.

Format

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

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

Parameters

Parameter Description Value
acl-number

Specifies the number of a basic ACL.

The value is an integer that ranges from 2000 to 2999.

ip-prefix ip-prefix-name

Specifies the name of an IPv4 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.

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).

direct

Configures a device to filter the direct routes to be advertised.

-

isis process-id

Specifies the ID of an IS-IS process.

The value is an integer ranging from 1 to 4294967295.

ospf process-id

Specifies the ID of an OSPF process.

The value is an integer ranging from 1 to 4294967295.

rip

Configures a device to filter the RIP routes to be advertised.

-

static

Configures a device to filter the static routes to be advertised.

-

Views

BGP view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

The filter-policy export command takes effect on the routes to be advertised by BGP. BGP filters the routes that are imported using the import-route command. After the command is run, only the routes that match the export policy can be added to the local BGP routing table and advertised by BGP.

The filter-policy import command is used to filter the routes received by BGP so that BGP adds only desired routes to the BGP routing table.

If protocol is specified, only the routes imported from the specified protocol will be filtered. If protocol is not specified, the routes imported from all protocols will be filtered.

If rules are configured for a named ACL using the rule command, only the source address range specified by source and the time period specified by time-range are valid.

Configuration Impact

If the filter-policy export command with the same protocol specified is run more than once, the latest configuration overrides the previous one.

If the filter-policy import command runs more than once, the latest configuration overrides the previous one.

Precautions

The filter-policy export command is mutually exclusive with the route-filter export command.

The filter-policy import command is mutually exclusive with the route-filter import command.

Example

# Use ACL 2000 to filter all the routes to be advertised by BGP.
<HUAWEI> system-view
[~HUAWEI] acl 2000
[*HUAWEI-acl4-basic-2000] quit
[*HUAWEI] bgp 100
[*HUAWEI-bgp] filter-policy 2000 export
# Use ip-prefix named aaa to filter the routes received by BGP.
<HUAWEI> system-view
[~HUAWEI] ip ip-prefix aaa permit 10.0.192.0 8 greater-equal 17 less-equal 18
[*HUAWEI] bgp 100
[*HUAWEI-bgp] filter-policy ip-prefix aaa import
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >