RE: BGP regular expression help

From: BRZYSKI, ADAM E (SWBT) (ab1723@xxxxxxx)
Date: Mon Nov 12 2001 - 17:57:14 GMT-3


   
Note the following

^ means begins with
$ means ends with

Keep in mind how the AS path is formed by BGP. Each time a BGP update
transverses from a particular AS to another AS the AS number of the exiting
AS is added to the AS path attribute. Boy that sentence is a mouthful. I
hope I did not confuse you. In case I did lets do an example. Lets say
that a route originated in AS 1 and has gotten propagated to AS 10 through
the following topology:

AS1-AS5-AS6-AS10

Within AS10 when looking at the BGP table you should see the following AS
path for all updates that originated in AS1

 6 5 1

Note that the originating AS is the left most number. With that said the
definitions above for ^ and $ are given from the perspective of what is
displayed in the BGP table. However in reality that perspective is reverse
of how the BGP process constructs the AS path attribute. Look at the
following examples

.* any
^$ Local AS
^1$ Only from AS 1
^6_ Received directly from AS 6
_1$ Originated from 100
_5_ via AS 5

Look at the following link for more help

http://www.cisco.com/univercd/cc/td/doc/product/atm/c8540/12_0/13_19/cmd_ref
/appc.htm#xtocid68796

Note the following command is very useful in checking the validity of your
regular expressions

show ip bgp regexp (regular expression)

Adam Brzyski
Design Engineer II
CCIE #8082, NNCDE

-----Original Message-----
From: Krake, Kris [mailto:KKrake@aegonusa.com]
Sent: Monday, November 12, 2001 2:12 PM
To: BRZYSKI, ADAM E (SWBT); ccielab@groupstudy.com
Subject: RE: BGP regular expression help

I am more interested in the show ip bgp regexp command to go through the bgp
route table. Therefore I need the logical not in the regular expression.
As for the expressions below: I know I'm green on regexp's but doesn't the
"^" mean originate. I would have thought the opposite of what you stated
below.

-----Original Message-----
From: BRZYSKI, ADAM E (SWBT) [mailto:ab1723@sbc.com]
Sent: Monday, November 12, 2001 2:48 PM
To: ccielab@groupstudy.com
Subject: RE: BGP regular expression help

ip as-path access-list 1 deny _123_1$
ip as-path access-list 1 permit .*

note that the access-list above will filter out any updates that originated
in AS 1 and directly went through AS 123

ip as-path access-list 1 deny ^1_123_
ip as-path access-list 1 permit .*

note that this access-list will filter out any updates that have arrived
into the local AS directly through AS 1 and 123.

In order for the filters to work they need to be applied to a neighbor
statement within your BGP configuration.

Hope this helps.

Adam Brzyski
Design Engineer II
CCIE #8082, NNCDE

-----Original Message-----
From: Krake, Kris [mailto:KKrake@aegonusa.com]
Sent: Monday, November 12, 2001 1:26 PM
To: ccielab@groupstudy.com
Subject: BGP regular expression help

How would you write the regular expression for the following:

all paths NOT starting with the 1 123 pattern (AS 1 followed by AS 123)

I know that ^1_123 would show me those patterns with 1 123 but I need the
opposite of that (logical not)...

I have tried ^[^1_123] and [^^1_123]

Thanks for guidance...

Kris



This archive was generated by hypermail 2.1.4 : Fri Jun 21 2002 - 06:45:13 GMT-3