filter to filter out the traffic carrying the number of the AS. If the BGP routing table of each
device on a network is large, configuring an ACL or an IP prefix list to filter BGP routes
may be complicated and make it difficult to maintain new routes.
NOTE
If the AS_Path information of a summarized route is lost, the AS_Path filter cannot be used to filter
the summarized route, but can still be used to filter the specific routes from which the summarized
route is derived.
An AS_Path filter can be used as a matching condition of a route-policy or be used in the
peer as-path-filter command.
Perform the following steps on a BGP switch:
1. Run:
system-view
The system view is displayed.
2. Run:
ip as-path-filter { as-path-filter-number | as-path-filter-name }
{ permit | deny } regular-expression
An AS_Path filter is configured.
An AS_Path filter uses a regular expression to define matching rules. A regular
expression consists of the following parts:
– Metacharacter: defines matching rules.
– General character: defines matching objects.
Table 7-2 Metacharacters
Metacharacter
Description
\ Escape character.
. Matches any single character except "\n", including spaces.
* An asterisk indicates that there are 0, 1, or any number of the
previous expression.
+ A plus sign indicates that there is at least 1 of the previous
expression.
| Matches either expression it separates.
^ Specifies the beginning of a line.
$ Specifies the end of a line.
[xyz] Matches any character in the brackets.
[^xyz] Matches a single character that is not contained within the
brackets.
[a-z] Matches any character within the specified range.
[^a-z] Matches any character out of the specified range.
S6700 Series Ethernet Switches
Configuration Guide - IP Routing 7 BGP Configuration
Issue 01 (2012-03-15) Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
397