From: Gregg Malcolm (greggm@xxxxxxxxxxxxx)
Date: Thu Mar 28 2002 - 00:34:56 GMT-3
After much testing, I think I understand a little more. I had a hard time
figuring out the difference between _50 and _50_ After adding a bunch more
AS path prepends, here's what I found :
50 matches anything with 50 (50, 150, 502, etc)
50_ matches anything that ends in 50 (50,150 but not 502)
_50 matches anything that starts with 50 (50,502 but not 150)
_50_ matches anything that has an exact path of 50.
In hindsight, all this is way too obvious. Pretty much exactly how it is
explained in Doyle II (although I wish he'd have spent a little more time on
it). It was still a good exercise as I don't think I'll be forgetting it
soon :)
Gregg
----- Original Message -----
From: "D. J. Jones" <meganac@attbi.com>
To: "Gregg Malcolm" <greggm@sbcglobal.net>; <ccielab@groupstudy.com>
Sent: Wednesday, March 27, 2002 1:50 PM
Subject: Re: BGP Reg Expressions
> Shouldn't the expression to deny all routes that passed thru AS 150 be
_150_
> ----- Original Message -----
> From: "Gregg Malcolm" <greggm@sbcglobal.net>
> To: <ccielab@groupstudy.com>
> Sent: Wednesday, March 27, 2002 1:01 PM
> Subject: Fw: BGP Reg Expressions
>
>
> > > Thanks Clay. Think the light is finally getting somewhat brighter for
> me.
> > > I set up a bunch of AS prepends on a router then played with filtering
> AS
> > > paths.
> > >
> > > From what I can see, there are a few important reg exp's to remember :
_
> ^
> > > and $
> > >
> > > _ matches any instance. Good for filtering transit AS info.
> > > ^ matches the beginning. Used for filtering paths beginning with an
AS
> > > number
> > > $ matches ends with. Used for filtering paths that end with an AS
> number.
> > > I find I must use _ then path then $ (eg _30$) to filter path that
> > > originated at path 30.
> > >
> > > I think these 3 along with .* and ^$ will hopefully get me thru the
> lab.
> > I
> > > believe that I can do any filtering with multiples of these. Let's
say
> > that
> > > I was asked to deny all routes that originated in path 50 and all
routes
> > > that passed thru 150 :
> > > ip as-path access-list 1 deny _50$
> > > ip as-path access-list 1 deny _150 (same as just 150 tho.. I need to
> test
> > > some more)
> > > ip as-path access-list 1 permit .*
> > >
> > > Sound right ? I'm certain that other expressions are very useful but
I'm
> > not
> > > sure that I can remember them all. Plus, I'm not really sure that
they
> > will
> > > be needed on the lab test.
> > >
> > > I've also found that sh ip bgp reg <expression> helps a bunch to test
> the
> > > expression before placing it in an as-path list. A great feature that
I
> > > never really used before.
> > >
> > > Gregg
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Clay Maney" <clay@openworldinc.com>
> > > To: "Gregg Malcolm" <greggm@sbcglobal.net>
> > > Sent: Wednesday, March 27, 2002 11:09 AM
> > > Subject: Re: BGP Reg Expressions
> > >
> > >
> > > > I'm not the guru here by any measure, but I can tell you this for
> sure:
> > > >
> > > > the ^ means "beginning with" and the $ means "ending with".
> > > >
> > > > so, ^30 means "where 30 is the first AS in the list", etc.
> > > >
> > > > hope that helps (and please let me know if I'm wrong)
> > > >
> > > > Clay
> > > >
> > > > On Wed, Mar 27, 2002 at 10:44:35AM -0800, Gregg Malcolm wrote:
> > > > > Folks,
> > > > >
> > > > > Does anyone have any good tips to help to remember reg expressions
?
> > > > > Unfortunately, my Unix background is pretty weak. I can remember
> some
> > > of the
> > > > > simple stuff like .* is all paths, ^$ is local routes (empty),
_30_
> is
> > > routes
> > > > > that passed thru path 30 , etc.
> > > > >
> > > > > The CD is very limited with info regarding this. Best CD info
I've
> > > found is
> > > > > an appendix in the dial section :
> > > > >
> > >
> >
>
http://127.0.0.1:8080/cc/td/doc/product/software/ios121/121cgcr/dial_r/drdap
> > > p
> > > > > /index.htm
> > > > >
> > > > > Mostly related to chat scripts from what I see. BTW - I swear
that
> if
> > I
> > > see a
> > > > > chat script on the lab I'll get up and leave immediately.
> > > > >
> > > > > My confusion is not so much with the meaning of the expressions,
but
> > > with how
> > > > > they are interpreted by BGP. For instance, what's the difference
> > > between ^30$
> > > > > and ^30_ ? Is it that ^30$ only matches 30 and nothing else and
> ^30_
> > > matches
> > > > > any path with 30 anywhere in it ?
> > > > >
> > > > > Does anyone have a standard set that they use that is somewhat
easy
> to
> > > > > remember ?
> > > > >
> > > > > TIA, Gregg
This archive was generated by hypermail 2.1.4 : Thu Jun 13 2002 - 10:57:24 GMT-3