Re: BGP Reg Expressions

From: D. J. Jones (meganac@xxxxxxxxx)
Date: Wed Mar 27 2002 - 18:52:49 GMT-3


   
Let me insert the whole command for completeness:

ip as-path access-list 1 deny _150_

dj
----- 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