Install guide

Filtering IP Routes 2-9
Software Version 2.7.5
C613-10454-00 REV A
Creating AS Path Lists for BGP
To create an AS path list and add entries to it, use one of the commands:
add ip aspathlist=1..99 [entry=1..4294967295]
include=aspath-reg-exp
add ip aspathlist=1..99 [entry=1..4294967295]
exclude=aspath-reg-exp
Each entry uses a regular expression, aspath-reg-exp, to both specify the AS
numbers that the entry matches, and to establish whether matching AS
numbers are included or excluded.
The following table shows regular expression syntax and examples:
You can apply AS path lists directly to BGP peers, or use them in route maps
(see “Matching on AS path list” on page 2-10).
Creating Route Maps for BGP
A route map consists of multiple entries, which are in effect individual filters.
Each entry specifies both what it matches on, in a match clause, and what is
done to matching traffic, in the entry’s action and any set clauses it has.
Most set clauses modify the BGP attributes of matching update messages. If
you want to change the attributes of all candidate routes, configure an entry
with no match clause. Such an entry matches all update messages.
Table 2-1: Syntax for AS path regular expressions
Token Description Examples Meaning of example
<AS number> Matches that identical AS number. 123 Matches any AS path attribute that contains
AS 123 (but not 1234, 12345, or 5123).
^ Matches the start of the AS path attribute. ^123
^$
^123$
Matches AS path attributes that have AS
123 as the first AS.
Matches an empty AS path attribute.
Matches an AS path attribute with a single
AS number, 123.
$ Matches the end of the AS path attribute.
<space> Separates AS numbers in a regular
expression.
“123 456” Matches AS path attributes that contain
ASs 123 and 456, in that order, with no
other AS numbers between them.
““ Surrounds regular expressions that contain
spaces.
. Matches any AS number. .*
“123 .* 456”
Matches all AS path attributes.
Matches AS path attributes that contain
ASs 123 and 456, in that order, with any
number of other AS numbers between
them.
* Matches zero or more repetitions of the
preceding token in the AS path list being
filtered.
+ Matches one or more repetitions of the
preceding token in the AS path list being
filtered.
“123 .+ 456” Matches AS path attributes that contain
ASs 123 and 456, in that order, with at least
one other AS number between them.