The if-match as-path length command configures a matching rule that is based on the AS_Path length.
The undo if-match as-path length command deletes a matching rule that is based on the AS_Path length.
By default, no matching rules that are based on the AS_Path length are configured.
if-match as-path length lengthVal
if-match as-path length greater-equal greEqualVal less-equal lessEqualVal
if-match as-path length { greater-equal greEqualVal | less-equal lessEqualVal }
undo if-match as-path length [ lengthVal | greater-equal greEqualVal less-equal lessEqualVal | { greater-equal greEqualVal | less-equal lessEqualVal } ]
Parameter | Description | Value |
---|---|---|
lengthVal |
Specifies the AS_Path length. |
The value is an integer ranging from 0 to 2047. |
greater-equal greEqualVal |
Specifies the minimum AS_Path length for matching. |
The value is an integer ranging from 0 to 2046. |
less-equal lessEqualVal |
Specifies the maximum AS_Path length for matching. |
The value is an integer ranging from 1 to 2047. |
Usage Scenario
To configure a matching rule that is based on the AS_Path length, run the if-match as-path length command. After the matching rule is configured, attributes of the routes that match the matching rule can be modified based on the apply clause.
Precautions
AS_Path is a private attribute of BGP. Therefore, matching rules that are based on the AS_Path length are mainly used to filter BGP routes.
If greEqualVal is configured, but lessEqualVal is not, the maximum value 2047 of lessEqualVal is used. If lessEqualVal is configured, but greEqualVal is not, the minimum value 0 of greEqualVal is used. If both greEqualVal and lessEqualVal are configured, lessEqualVal must be greater than greEqualVal.