From: Przemyslaw Karwasiecki (karwas@xxxxxxxxxxx)
Date: Mon Aug 19 2002 - 14:54:07 GMT-3
Brian,
So technically speaking, underscore "_" character is matching
space, comma, braces etc, but null character too, right?
Otherwise, prefixes originated in 4 would be not matched,
as [0-9]* reduces to null, but there is still "_" just after 4
in the regex pattern, but not in AS_PATH.
Przemek
On Mon, 2002-08-19 at 13:32, Brian McGahan wrote:
> ^4_[0-9]*$
>
> This is matching prefixes originated in AS 4, and prefixes originated in
> the AS's directly connected to AS 4. If you want to show everything that
> is learned from AS 4, you could take the $ off of the end:
>
> ^4_[0-9]*
>
> But that's the same as just saying:
>
> ^4_
>
> I didn't read this whole thread, but I'm assuming the discussion was
> about prefixes originated in AS 4 and AS 4's customer's routes.
>
> Brian McGahan, CCIE #8593
> Director of Design and Implementation
> brian@cyscoexpert.com
>
> CyscoExpert Corporation
> Internetwork Consulting & Training
> http://www.cyscoexpert.com
> Voice: 847.674.3392
> Fax: 847.674.2625
>
>
> -----Original Message-----
> From: Song Mu [mailto:songmu@yahoo.com]
> Sent: Monday, August 19, 2002 12:17 PM
> To: Brian McGahan; 'elping'; 'Michael Snyder'
> Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com
> Subject: RE: Filtering BGP updates using ip as-path access-lists
>
> With the $ can only show one AS# after AS#4. It will show all the
> prepend AS#s if the $ been removed from the end.
>
> Song
> --- Brian McGahan <brian@cyscoexpert.com> wrote:
> > Elping, don't forget to match the 0.
> >
> > If you're trying to match routes learned from AS 4, and their
> > customer routes, the string would be:
> >
> > ^4_[0-9]*$
> >
> > Translating to:
> >
> > ^4_ Learned from AS 4
> > [0-9]* 0 or more instances of any character 0 through 9
> > $ end of string
> >
> > As Elping said, the easiest way to practice these regular
> > expressions is to test them on a route-server.
> >
> > telnet://route-server.exodus.net
> >
> > Try this one: All routes originated in AS 10, passed through AS
> > 100, and learned from AS 1000. (In one line)
> >
> > HTH
> >
> > Brian McGahan, CCIE #8593
> > Director of Design and Implementation
> > brian@cyscoexpert.com
> >
> > CyscoExpert Corporation
> > Internetwork Consulting & Training
> > http://www.cyscoexpert.com
> > Voice: 847.674.3392
> > Fax: 847.674.2625
> >
> >
> > -----Original Message-----
> > From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> > Of
> > elping
> > Sent: Sunday, August 18, 2002 9:46 AM
> > To: Michael Snyder
> > Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com
> > Subject: Re: Filtering BGP updates using ip as-path access-lists
> >
> > steve :
> > consider that
> > ^4 [0-9]* will be an exact 4 and some other number
> > so any routes coming from 4 will not show up...
> >
> > i put your theory to the test on an actual Bgp routing table observ.
> > I am using 7788 and all it's connected routes..
> >
> > in summary the underscore will allow 7788 routes and it's
> > connected...without the underscore
> > you are saying a exact 7788 and it's connected.....see for
> > yourself...
> >
> > if i mistyped or got you thoughts wrong feel free to correct..
> >
> >
> >
> > using your string i obtain nothing
> > route-server.east>sh ip bgp reg ^7788 [0-9]* [0-9]*$
> > route-server.east>
> >
> > observ the string sh ip bgp reg ^7788_[1-9]*$ ---that is with the
> > underscore
> > route-server.east>sh ip bgp reg ^7788 [0-9]* [0-9]*$
> >
> > route-server.east>sh ip bgp reg ^7788_[1-9]*$
> > BGP table version is 97446699, local router ID is 216.191.65.118
> > Status codes: s suppressed, d damped, h history, * valid, > best, i -
> > internal
> > Origin codes: i - IGP, e - EGP, ? - incomplete
> >
> > Network Next Hop Metric LocPrf Weight Path
> > *>i64.26.128.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > *>i192.203.106.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i192.222.1.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i192.222.2.0/23 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i192.222.4.0/22 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i192.222.8.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i198.96.127.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i198.96.199.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i199.71.68.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i204.138.103.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i204.187.103.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i204.225.145.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i205.207.175.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i205.233.68.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i206.51.251.0 216.191.224.1 100 0 7788 i
> > * i 216.191.224.1 100 0 7788 i
> > *>i206.191.0.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > *>i209.217.64.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > route-server.east>
> >
> > observe without the underscore sh ip bgp reg ^7788 [1-9]*$
> >
> > route-server.east>sh ip bgp reg ^7788 [1-9]*$
> > BGP table version is 97446794, local router ID is 216.191.65.118
> > Status codes: s suppressed, d damped, h history, * valid, > best, i -
> > internal
> > Origin codes: i - IGP, e - EGP, ? - incomplete
> >
> > Network Next Hop Metric LocPrf Weight Path
> > *>i64.26.128.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > *>i206.191.0.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > *>i209.217.64.0/18 216.191.224.1 100 0 7788
> > 7788 i
> > * i 216.191.224.1 100 0 7788
> > 7788 i
> > route-server.east>sh ip bgp reg ^7788_[1-9]*$
> >
> >
> >
> >
> > Michael Snyder wrote:
> >
> > > _ (Matches a comma (,), left brace ({), right brace (}), the
> > beginning
> > > of the input string, the end of the input string, or a space.
> > >
> > > Steve I just wanted to match a space. Thats why I didn't use _ ,
> > Cisco
> > > shows examples of not using _ to match spaces. In other words, a
> > space
> > > char will match a space character.
> > >
> > > I stand by my expression of ^4 [0-9]* [0-9]*$
> > >
> > > I think another legal expression would be ^4 12 16 3$ notice that _
> > > isn't needed.
> > >
> > > -----Original Message-----
> > > From: steven.j.nelson@bt.com [mailto:steven.j.nelson@bt.com]
> > > Sent: Thursday, August 15, 2002 10:14 AM
> > > To: msnyder@ldd.net
> > > Subject: RE: Filtering BGP updates using ip as-path access-lists
> > >
> > > Michael
> > >
> > > You have missed out the _
> > >
> > > ^4_[0-9]*_[0-9]*$
> > >
> > > Steve
> > >
> > > -----Original Message-----
> > > From: Michael Snyder [mailto:msnyder@ldd.net]
> > > Sent: 15 August 2002 15:53
> > > To: 'Chaim Gev'
> > > Cc: ccielab
> > > Subject: RE: Filtering BGP updates using ip as-path access-lists
> > >
> > > ^4 [0-9]* [0-9]*$
> > >
> > > Would match any AS that was directly connected to an AS that was
> > > directly connected to AS 4. Is this correct?
> > >
> > > Also I think the expression you cited ^_4_[0-9]*$ is different than
> > > ^4_[0-9]*$. If they are the same, why not use the shorter one?
> > >
> > > Please Advise
> > >
> > > -----Original Message-----
> > > From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On
> > Behalf
> > Of
> > > Chaim Gev
> > > Sent: Thursday, August 15, 2002 8:13 AM
> > > To: msnyder@ldd.net; raj.bahad@totalise.co.uk
> > > Cc: ccielab@groupstudy.com
> > > Subject: RE: Filtering BGP updates using ip as-path access-lists
> > >
> >
> === message truncated ===
>
>
This archive was generated by hypermail 2.1.4 : Sat Sep 07 2002 - 19:48:29 GMT-3