BGP Overview
Configuring BGP
page 3-14
OmniSwitch AOS Release 7 Advanced Routing Configuration Guide
March 2011
•
It makes writing (and reading) policies much easier.
•
It enables the router to begin using the policies more quickly after startup.
For example, to identify routes originating from internal autonomous systems, you would use the pattern:
[64512-65535]$
which means “match any AS number from 64512 to 65535 (inclusive) which occurs at the end of the AS
path.” To accomplish the same thing using character-based pattern matching, you would have to use the
following pattern:
(_6451[2-9]_|_645[2-9][0-9]_|_64[6-9][0-9][0-9]_|_65[0-9][0-9][0-9]_)$
Some examples of valid regular expressions are shown in the following table:
Example
Description
100
Meaning:
Any route which passes through AS number 100.
Matches:
100 200 300
300 100 100
Doesn’t Match:
200 300
^100
Meaning:
Any routes for which the next hop is AS number 100.
Matches:
100 200 100
Doesn’t Match:
50 100 200
100$
Meaning:
Any route which originated from AS number 100 (AS numbers are
prepended to the AS path list as they are passed on, so the originat-
ing AS is always the last number in the list).
Matches:
100
200 200 100
Doesn’t Match:
100 200
^100 500$
Meaning:
A route with just two hops, 100 and 500.
Matches:
100 500
Doesn’t Match:
100 500 600
100 200 500
100 . . 200
Meaning:
Any route with at least 4 hops, with 100 separated by any two hops
from 200.
Matches:
50 100 400 500 200 600
100 100 100 200
Doesn’t Match:
100 200
100 100 200
(100|200).+
[500-650]$
Meaning:
Any route which begins with 100 or 200, ends with an AS number
between 500 and 650 (inclusive), and is at least three hops in length.
The “.+” part matches at least one (but possibly more) AS numbers.