if-match extcommunity-filter

Function

The if-match extcommunity-filter command sets a matching rule that is based on the extended community filter.

The undo if-match extcommunity-filter command cancels the configuration.

By default, no matching rule based on the extended community filter is set.

Format

if-match extcommunity-filter { { basic-extcomm-filter-num | adv-extcomm-filter-num } &<1-16> | extcomm-filter-name }

undo if-match extcommunity-filter [ [ basic-extcomm-filter-num | adv-extcomm-filter-num ] &<1-16> | extcomm-filter-name ]

Parameters

Parameter Description Value
basic-extcomm-filter-num Specifies the number of the basic extended community filter. It is an integer that ranges from 1 to 199.
advanced-extcomm-filter-num Specifies the number of the advanced extended community filter. It is an integer that ranges from 200 to 399.
extcomm-filter-name Specifies the name of the extended community filter. The name is a string of 1 to 51 case-sensitive characters without any spaces. The string cannot be all numbers.
NOTE:
When double quotation marks are used around the string, spaces are allowed in the string.

Views

Route-policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The extended community attributes help flexibly control the route-policy. You can use the if-match extcommunity-filter command to configure a node to filter routes based on the extended community filter. After such a matching rule is configured, you can apply the apply clauses to change the attributes of the routes that match the extended community attributes-based matching rule.

The if-match extcommunity-filter command is applicable to only BGP routes and must work in conjunction with the ip extcommunity-filter command. For example:

  • If the if-match extcommunity-filter 1 command is used but the extcommunity filter 1 is not configured, all routes are permitted, that is, all routes can match the matching rule.
  • If the if-match extcommunity-filter 1 command is used after the ip extcommunity-filter 1 permit rt 1:1 command is used, the BGP routes with the extended community attribute being 1:1 are permitted.

Prerequisites

Before using the if-match extcommunity-filter command, you must use the ip extcommunity-filter command to configure an extended community filter.

Configuration Impact

When you filter routes based on the extended community attributes, the routes that match the matching rule are permitted and the routes that do not match the matching rule are denied.

Precautions

A maximum of 16 extended community filters can be configured in the if-match extcommunity-filter command.

Example

# Define a rule to match the routes of the specified extended community filter.

<sysname> system-view
[sysname] route-policy policy permit node 10
[sysname-route-policy] if-match extcommunity-filter 100

Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.