filter-policy (BGP-IPv4 multicast address family view)

Function

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

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

By default, information about advertised and received routes is 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 value is a string of 1 to 169 case-sensitive characters, 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, spaces not supported. The value must start with a letter (a to z or A to Z).

import

Specifies the import routes.

-

export

Specifies the export routes.

-

direct

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

-

isis

Configures a device to filter the IS-IS routes to be advertised.

-

process-id

Specifies the ID of a process in which routes are to be filtered.

The value is an integer that ranges from 1 to 4294967295.

ospf

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

-

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-IPv4 multicast address family 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.

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 MBGP.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] ipv4-family multicast
[*HUAWEI-bgp-af-multicast] filter-policy 2000 export
# Use ip-prefix named aaa to filter the routes received by MBGP.
<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] ipv4-family multicast
[*HUAWEI-bgp-af-multicast] filter-policy ip-prefix aaa import
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >