From: Bauer, Rick (BAUERR@xxxxxxxxxxx)
Date: Thu Aug 22 2002 - 19:05:28 GMT-3
Yep, I see that. Even with underscores it brings back too much. I guess the
lessons learned are not to look for too simple of an answer and regular
expressions are black magic! Wow, pretty cool! Good catch I would have
stopped long ago.
sho ip bgp reg ^7018_?.* 291._?.* 151$
Rick, #9482
-----Original Message-----
From: Edward Monk [mailto:emonk@att.net]
Sent: Thursday, August 22, 2002 4:31 PM
To: 'Bauer, Rick'
Cc: ccielab@groupstudy.com
Subject: RE: regexp fun
Rick,
Yes, but the expression still doesn't meet the requirements.
Try this and it should pull up the same list. That's were the problem
is.
ip bgp reg ^7018 ?.* 291. ?.* 151$<--- this is your original
ip bgp reg ^701 ?.* 291. ?.* 151$<---- notice the 8 missing out front?
Does it still pull up the routes? Should it?
Try it with just a ^7 in place of the ^7018. Still works doesn't it. How
about no AS number after the ^, still works now.
See what I mean.
-----Original Message-----
From: Bauer, Rick [mailto:BAUERR@toysrus.com]
Sent: Thursday, August 22, 2002 2:09 PM
To: 'Edward Monk'
Cc: 'ccielab@groupstudy.com'
Subject: RE: regexp fun
I always explain this stuff like crap so let me show you. Here is an
example
on a route-server. I subsituted a . for one digits in the string and
went to
my route-server and did a sh ip bgp reg ^7018 ?.* 291. ?.* 151$
This illustrates the as (2914 and 2915) in different positions in the as
path. I'm pretty sure that this meets the requirement of traversing.
Make
any sense?
-----clip------
* 12.123.196.111 0 7018 5727
2915
151 i
* 192.205.31.33 0 7018 5727
2915
151 i
*> 12.123.1.234 0 7018 5727
2915
151 i
* 192.170.64.0/20 12.123.9.241 0 7018 2914
4657
151 i
*> 12.123.139.124 0 7018 2914
4657
151 i
* 12.123.134.124 0 7018 2914
4657
151 i
* 12.123.41.250 0 7018 2914
4657
151 i
-----clip-----
Rick, #9482
-----Original Message-----
From: Edward Monk [mailto:emonk@att.net]
Sent: Thursday, August 22, 2002 3:52 PM
To: 'Bauer, Rick'; ccielab@groupstudy.com
Subject: RE: regexp fun
I used to think that as recent as yesterday. But it doesn't meet the
criteria.
It will match 10000 100 10 for sure.
Now think of this logic.
Here was my first working solution that satisfied the criteria.
Brian never said be as efficient as possible. (Lame excuse)
It took four branches to perform the logic as I understood it.
Match 1000 100 10 if not then
Match 1000 100 ([0-9].*) 10 if not then
Match 1000 ([0-9].*) 100 10 if not then
Match 1000 ([0-9].*) 100 ([0-9].*) 10 if not then
End
This worked out to be in long hand as the following expression.
((^1000 100 10$)|(^1000 100 ([0-9].*) 10$)|(^1000 ([0-9].*) 100
10$)|(^1000 ([0-9].*) 100 ([0-9].*) 10$))
I have since solved this in a very compact solution. One I believe is as
compact as it gets and still meets the criteria that Brian laid out.
-----Original Message-----
From: Bauer, Rick [mailto:BAUERR@toysrus.com]
Sent: Thursday, August 22, 2002 1:42 PM
To: 'Edward Monk'; 'ccielab@groupstudy.com'
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
ac cess-lists)
What I mean is I am a dumb ass and have been smoking crack all day and I
should stick to doing one thing at a time or at least devoting more then
two
seconds to reply to something. Yes you are correct it is backwards. But
it
should work this way.
sho ip bgp reg ^1000 ?.* 100 ?.* 10$
-----Original Message-----
From: Edward Monk [mailto:emonk@att.net]
Sent: Thursday, August 22, 2002 3:36 PM
To: 'Bauer, Rick'
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
ac cess-lists)
Yes, your point is what?
-----Original Message-----
From: Bauer, Rick [mailto:BAUERR@toysrus.com]
Sent: Thursday, August 22, 2002 1:23 PM
To: 'Edward Monk'
Cc: ccielab@groupstudy.com
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
ac cess-lists)
I'm giving a "sho ip bgp reg" not an as-path filter.
-----Original Message-----
From: Edward Monk [mailto:emonk@att.net]
Sent: Thursday, August 22, 2002 3:18 PM
To: 'Bauer, Rick'
Cc: ccielab@groupstudy.com
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
ac cess-lists)
Still not correct. Besides being reverse logic what I mean by that is
your regexp says match routes originated in AS 1000 not 10 as Brian's
criteria called for. But accounting for that it still would not work.
The beginning would match 1 10 100 1000 10000 at the very least.
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Bauer, Rick
Sent: Thursday, August 22, 2002 12:21 PM
To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
Cc: 'ccielab@groupstudy.com'
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
ac cess-lists)
Not correct I need another "?"
sh ip bgp reg ^10 ?.* 100 ?.* 1000$
Rick, #9482
-----Original Message-----
From: Bauer, Rick
Sent: Thursday, August 22, 2002 2:09 PM
To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
Cc: ccielab@groupstudy.com
Subject: RE: regexp fun (was RE: Filtering BGP updates using ip as-path
access-lists)
Okay Brain, you intrigued me. Here is the regular expression for your
question. You helped me find a new use for the "?". Cool stuff!
sh ip bgp reg ^10 ?.* 100 .* 1000$
Rick, #9482
-----Original Message-----
From: Brian McGahan [mailto:brian@cyscoexpert.com]
Sent: Wednesday, August 21, 2002 10:21 AM
To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com
Subject: regexp fun (was RE: Filtering BGP updates using ip as-path
access-lists)
Did we give up already?
<snip>
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
>
> The "*" means "match 0 or more sequences of the pattern" which is null
> in
> your suggestion.
> ^_4_[0-9]*$ is more accurate if you are asked to filter exactly AS4
(and
> not
> AS14).
>
> >From: "Michael Snyder" <msnyder@ldd.net>
> >Reply-To: "Michael Snyder" <msnyder@ldd.net>
> >To: "'Raj'" <raj.bahad@totalise.co.uk>
> >CC: <ccielab@groupstudy.com>
> >Subject: RE: Filtering BGP updates using ip as-path access-lists
> >Date: Thu, 15 Aug 2002 07:52:31 -0500
> >
> >I'm no expert on as-path access-lists.
> >
> >But, I believe the $ is the main difference.
> >
> >^4_ anything beginning with as path 4.
> >
> >^4_[0-9]*$ anything beginning with as path 4 and ENDS with one
> >additional AS.
> >
> >Which brings up a question of mine,
> >
> >Why wouldn't ^4_*$ do the same thing?
> >
> >
> >
> >-----Original Message-----
> >From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
Of
> >Raj
> >Sent: Thursday, August 15, 2002 7:02 AM
> >To: ccielab@groupstudy.com
> >Subject: Filtering BGP updates using ip as-path access-lists
> >
> >Hi all,
> >
> >I've come across a scenario for which I require some clarification.
> >
> >I want to permit only networks originated from AS4, and AS's directly
> >attached to AS4. I use the following config to meet the requirements,
> >however I have come across documentation that has achieved the same
> >results
> >using a slightly different version. I've listed both of them below:
> >
> >ip as-path access-list 1 permit ^4_
> >
> >and the other being:
> >
> >ip as-path access-list 1 permit ^4_[0-9]*$
> >
> >Could someone please help clarify why one method would be preferred
> over
> >the
> >other?
> >
> >Thanks,
> >
> >Raj.
This archive was generated by hypermail 2.1.4 : Sat Sep 07 2002 - 19:48:34 GMT-3