ip aspath-list configuration command directory
Establish as-path list regulation to match BGP route. Use command “no” to
delete as-path list configured.
ip
as-path access-list <name> <deny | permit> <regexp>
no
ip as-path access-list <name> [deny | permit] [regexp]
<name> name of as-path-list
<deny | permit> character
of as-path-list regulation
<regexp> as-path property regular
expression
Default:
Default refuses all as-path expression
except for those with clearly stated permit.
global configuration mode
AS path list
is used to filter BGP routes according
to routes’s AS_PATH attribute. AS_PATH attribute of BGP routes are series of
numbers (indicating autonomous system number). They are usually expressed in
character strings. The number on the most right side is the number of
autonomous system originating this route. Then there are numbers of autonomous
systems passed through. For example, 22 23 98, means that this route originated
by autonomous system 98, then passes through autonomous systems 23 and 22, and
reaches this autonomous system.
AS path list
is indicted with names. The total number of AS PATH list in the system is only
constrained by system resource. Several matching rules can be configured under
one as-path list. The process to apply the
as-path list is to check in turn according to configuration orders. Once a rule
is matched successfully, stop the following check and return the attribute of
this rule (deny/permit). If all rules cannot be matched successfully, return
deny. Every rule is organized according to configuration orders. The “as path”
expression is expressed in regular expressionwith the following commonly used
special characters of expression:
Character |
Symbol |
Meaning |
Period |
. |
To match any single character including blank character. |
Star |
* |
Matching 0 or more series in the mode. |
Plus |
+ |
Matching 1 or more series in the mode. |
Question mark |
! |
Matching 0 or 1 time appearance in the mode (the same to “?”). |
Adding symbol |
^ |
Matching the beginning of entering character strings. |
Symbol $ |
$ |
Matching the end of entering character strings. |
Underline |
_ |
Matching comma, left big bracket, right big bracket, left bracket,
right bracket, beginning of entering character strings, ending of entering
character strings, or a space. |
Brackets |
[Range] |
Means the range of single character
mode. |
Slash |
- |
Separate a range. |
Use regular expression with right expression of path attribute will
establish powerful as path list. The following are some examples:
.* Means any as path attributes.
^$ Means empty path attribute.
^22$ Means attribute of path only
containing autonomous system 22.
^22_ Means path attribute beginning
with 22, such as 22, 22 33.
_22$ Means path attribute ending
with 22, such as 22, 34 22,99 45 22.
_22_ Means path attribute containing
22, such as 23 22 45,442
22 23 44.
Example:
The as-path list
hell defined in the following example will only permit path attribute beginning
with 23 or containing 22:
ip as-path access-list hell
permit ^23
ip as-path access-list hell
permit _22_
ip as-path access-list
guangzhou deny ^300
ip as-path access-list
guangzhou deny _300_
ip as-path access-list
guangzhou permit .*
All as-path attributes beginning with 300
of containing 300 are refused. Others are passed. The result will be different
if the order of defining is different. In the following example, all as-path
attributes will pass.
ip as-path access-list
guangzhou permit .*
ip as-path access-list
guangzhou deny ^300
ip as-path access-list
guangzhou deny _300_
Show as path list configured
in the system. Designating names can show designated as path list information.
show
ip as-path-list <name>
<name> name of as path-list
none
Supervisor
mode
If name is not designated, all information
of as path list configured in the system.
In the following example, all as path
lists will be showed:
show ip as-path-list