< Home

if-match as-path-filter

Function

The if-match as-path-filter command creates a matching rule based on the AS_Path filter.

The undo if-match as-path-filter command deletes a matching rule based on the specified AS_Path filter.

By default, no matching rule based on the AS_Path filter is configured.

Product

Support

S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S

Supported.

S2720-EI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S6720-LI, and S6720S-LI

Not supported.

Format

if-match as-path-filter { as-path-filter-number &<1-16> | as-path-filter-name }

undo if-match as-path-filter [ as-path-filter-number &<1-16> | as-path-filter-name ]

Parameters

Parameter Description Value
as-path-filter-number Specifies the number of an AS_Path filter. A maximum of 16 AS_Path filters can be specified. The value is an integer ranging from 1 to 256.
as-path-filter-name Specifies the name of the AS_Path filter. The name is a string of 1 to 51 case-sensitive characters without spaces. The value cannot contain only numerals.
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 AS_Path attribute is the private attribute of BGP. The if-match as-path-filter command is applicable to only BGP routes. The ip as-path-filter command must be used to define an AS_Path filter so that the matching rule based on this AS_Path filter can take effect. For example:

  • If the if-match as-path-filter 1 command is used but AS_Path filter 1 is not configured, all routes are permitted, that is, all routes match the matching rule.
  • If the if-match as-path-filter 1 command after the ip as-path-filter 1 permit *20 command is used, the BGP routes with the AS_Path attribute being 20 are permitted.

Multiple if-match as-path-filter clauses can be specified. The relationship between if-match as-path-filter clauses is "OR". The relationship between if-match clauses is "AND".

Prerequisites

Before running the if-match as-path-filter command, run the ip as-path-filter command to configure an AS_Path filter.

Precautions

The routing policy matches routes using the AS-Path filter. Routes that match the AS-Path filter will be checked by other if-match clauses of this node. Routes that do not match the AS-Path filter will be checked by the next node.

A maximum of 16 AS_Path filters can be specified. The relationship between these AS_Path filters is OR. Specifically, if a route matches one of these AS_Path filters, it matches the matching rules of the command.

Creating an AS_Path filter before it is referenced is recommended. By default, nonexistent AS_Path filters cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent AS_Path filter is referenced using the current command, all routes match the AS_Path filter.

Example

# Configure AS_Path filter 2 to permit AS200 and AS300. Create a routing policy named test, and define AS_Path filter 2 in an if-match clause for node 10 of the routing policy.

<HUAWEI> system-view
[HUAWEI] ip as-path-filter 2 permit _200_300
[HUAWEI] route-policy test permit node 10
[HUAWEI-route-policy] if-match as-path-filter 2
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >