if-match extcommunity-list encapsulation

Function

The if-match extcommunity-list encapsulation command configures a matching rule based on an encapsulation extended community filter.

The undo if-match extcommunity-list encapsulation command cancels the configuration.

By default, no matching rule based on an encapsulation extended community filter is configured.

Format

if-match extcommunity-list encapsulation encapsulation-name

undo if-match extcommunity-list encapsulation encapsulation-name

Parameters

Parameter Description Value
encapsulation-name

Specifies the name of an encapsulation extended community filter.

The value is a string of 1 to 51 case-sensitive characters. It cannot be comprised of only digits. If spaces are used, the string must start and end with double quotation marks (").

Views

Route-policy view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
route-base write

Usage Guidelines

Usage Scenario

Extended community attributes help flexibly control a route-policy. To configure a matching rule based on an encapsulation extended community filter, run the if-match extcommunity-list encapsulation command.

  • Run the route-policy command to configure a route-policy or enter the view of an existing route-policy.
  • A route-policy may consist of multiple nodes, and the relationship among these nodes is OR. The system matches routes against the nodes in ascending order of node IDs. If a route matches a node in the route-policy, the route is not matched against the next node.
  • Each node comprises a set of if-match and apply clauses. The if-match clauses define matching rules that are based on route attributes. The relationship among if-match clauses of the same node that are based on different route attributes is AND. Specifically, a route matches a node only when it meets all the if-match clauses of the node. The relationship among if-match clauses of the same node that are based on the same route attribute is OR; the system matches routes against the if-match clauses in order; if a route matches an if-match clause, the route matches the route-policy, and the system no longer matches the route against the rest if-match clauses. For example, the if-match community-filter 1 and if-match as-path-filter 1 configurations in node 10 are based on different route attributes. Therefore, the relationship among if-match clauses of this node is AND. The if-match community-filter 1 and if-match community-filter 2 configurations in node 20 are both based on the community attribute. Therefore, the relationship among if-match clauses of this node is OR. The apply clauses specify actions. If a route matches a node, the apply clauses set route attributes for the route. The if-match extcommunity-list encapsulation command is mainly used to match BGP EVPN routes and requires the ip extcommunity-list encapsulation command to be configured. For example:
  • If the if-match extcommunity-list encapsulation basic aaa command is run but the filter named aaa is not configured, all BGP routes are permitted.
  • If the if-match extcommunity-list encapsulation basic aaa and ip extcommunity-list encapsulation basic aaa permit 0:1 0:2 0:3 commands are run, BGP routes carrying the community attribute 0:1 0:2 0:3 are permitted.

Prerequisites

An encapsulation extended community filter has been configured using the ip extcommunity-list encapsulation command.

Example

# Configure a matching rule based on an encapsulation extended community filter.
<HUAWEI> system-view
[~HUAWEI] ip extcommunity-list encapsulation basic aaa index 10 permit 0:1 0:2 0:3
[*HUAWEI] route-policy policy permit node 10
[*HUAWEI-route-policy] if-match extcommunity-list encapsulation aaa
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >