From: Huizinga, Rene (rhuizinga@upcbroadband.com)
Date: Thu Dec 28 2006 - 22:04:22 ART
Hi Luca,
Hmmm, that looks bad... Seems like, when comparing to the cmd-reference for
regexp's, this '\x' feature is implemented a bit buggy because it includes
the '_174' or at least the '174' as part of the regexp fetched by '\1',
although according to the reference, it should just take what's between the
round bracket's !
Maybe if you modify it slightly to ensure a '_' is after the first AS,
hopefully this IOS running would accept this better as 'delimiter' between
the 2 entries... So something like in your sample here:
_174_([0-9]+_)*\1*$
Or in case of the original example:
^54_([0-9]+_)*\1*$
A great moment to punish those public looking-glasses with regexp-capability
I'd say :)))
(Though assuming/hoping their underlying scripts ofcourse accept all input
:) )
Now just did some checking on a box with a full table and must say... Either
the IOS-version is bad, or this version works quite sheit, c.q. simply
doesn't work...:)
sh ip bgp regexp _174_([0-9]+_)*\1*$
*>i4.36.118.0/24 213.46.161.250 0 250 0 174 21889 i
*>i8.4.86.0/24 213.46.161.250 0 250 0 174 14627 i
*>i8.5.244.0/24 213.46.161.250 0 250 0 174 19397 19397
19397 19397 i
*>i8.6.240.0/24 213.46.161.250 0 250 0 174 31846 31846
i
*>i8.6.241.0/24 213.46.161.250 0 250 0 174 33724 33724
33724 33724 33724 33724 33724 ?
*>i8.8.178.0/24 213.46.161.250 0 250 0 174 36129 i
*>i8.8.192.0/23 213.46.161.250 0 250 0 174 14728 14728
14728 14728 i
*>i8.8.196.0/22 213.46.161.250 0 250 0 174 14728 14728
14728 14728 i
*>i8.8.200.0/23 213.46.161.250 0 250 0 174 14728 14728
14728 14728 i
*>i8.8.202.0/23 213.46.161.250 0 250 0 174 14728 14728
14728 14728 i
*>i8.15.3.0/24 213.46.161.250 0 250 0 174 23249 23249
23249 23249 i
*>i8.15.12.0/24 213.46.161.250 0 250 0 174 19397 19397
19397 19397 i
*>i12.0.29.0/24 213.46.161.250 0 250 0 174 30538 i
*>i12.0.48.0/20 213.46.161.250 0 250 0 174 1742 i
*>i12.6.195.0/24 213.46.161.250 0 250 0 174 30140 i
*>i12.6.208.0/20 213.46.161.250 0 250 0 174 1742 i
*>i12.9.124.0/24 213.46.161.250 0 250 0 174 35976 i
*>i12.18.49.0/24 213.46.161.250 0 250 0 174 27490 i
*>i12.20.147.0/24 213.46.161.250 0 250 0 174 174 174 174
16810 21689 i
*>i12.25.52.0/23 213.46.161.250 0 250 0 174 5760 10346
i
*>i12.28.188.0/24 213.46.161.250 0 250 0 174 33146 i
*>i12.29.33.0/24 213.46.161.250 0 250 0 174 26835 i
*>i12.29.38.0/24 213.46.161.250 0 250 0 174 26696 i
*>i12.30.17.0/24 213.46.161.250 0 250 0 174 30460 i
*>i12.31.127.0/24 213.46.161.250 0 250 0 174 7228 23087
23087 23087 23087 I
Or a different flavor of the month:
sh ip bgp regexp _174_([0-9]*_)\1*$
This flavor seemed to work somewhat better with the differ that you either
simply get NO prepended entries and all with a single or double
AS-path-length, or simply with something completely wrong again... ;)
*>i63.237.145.0/24 213.46.161.250 0 250 0 174 30105 i
*>i63.238.160.0/19 213.46.161.250 0 250 0 174 174 174 174
16810 i
*>i63.243.189.0/24 213.46.161.250 0 250 0 174 36158 i
*>i63.246.192.0/22 213.46.161.250 0 250 0 174 15270 i
*>i63.246.192.0/19 213.46.161.250 0 250 0 174 15270 i
*>i63.246.196.0/23 213.46.161.250 0 250 0 174 15270 i
*>i63.246.198.0/24 213.46.161.250 0 250 0 174 15270 i
*>i63.246.199.0/24 213.46.161.250 0 250 0 174 15270 i
*>i63.246.200.0/23 213.46.161.250 0 250 0 174 15270 i
*>i63.246.202.0/23 213.46.161.250 0 250 0 174 15270 i
*>i63.246.206.0/23 213.46.161.250 0 250 0 174 15270 i
*>i63.246.208.0/22 213.46.161.250 0 250 0 174 15270 i
*>i63.246.212.0/22 213.46.161.250 0 250 0 174 15270 i
Tried both flavors with the '\1' between round brackets as well, but no
luck, exactely the same output as without. This is running on a 7206VXR with
NPE-G1 and a 12.4(9)T1 release...
Ehrm, I'd say, looks like possibly we've hit one of those things that
theoretically could/should work but practically doesn't...in other words a
perfect exotic thing no one's normally using and perfect for the lab or
theory-exams... [VEG]
Cya
Rene.
-----Original Message-----
From: Bit Gossip [mailto:bit.gossip@chello.nl]
Sent: Thursday, December 28, 2006 11:47 PM
To: Huizinga, Rene
Cc: ccielab@groupstudy.com
Subject: RE: BGP Reg Exp
Hi Rene, GS,
it seems to work quite erratically:
re1>show ip bgp regexp _174(_[0-9]+)*\1*$
.....
*>i24.73.165.0/24 213.46.161.250 0 250 0 174 33363 i
*>i24.73.234.0/24 213.46.161.250 0 250 0 174 33363
33363 i
*>i24.75.137.0/24 213.46.161.250 0 250 0 174 174 174
174 16810 30299 30299 30299 30299 30299 30299 30299 i
*>i24.75.140.0/24 213.46.161.250 0 250 0 174 174 174
174 16810 32425 i
....
Look at the last one !!
Luca.
On Wed, 2006-12-27 at 22:45 +0100, Huizinga, Rene wrote:
> Darn, not going well here today, forgetting the '*' after the first
> expression to match the 0 or more occurances...sorry about
> that...thinking of one thing, typing the other, that's what you get
> when being half-focussed/having other things on your mind as well...
> Probably one of the reasons why some people are failing a lab... :(
>
> So ^54(_[0-9]+)*\1*$
>
> Alternatively what should also work: ^54(_[0-9]*)\1*$
>
> Optionally again the \1 as (\1)
>
>
> Cya
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> Of Huizinga, Rene
> Sent: Wednesday, December 27, 2006 10:28 PM
> To: 'Bit Gossip'; ccielab@groupstudy.com
> Subject: RE: BGP Reg Exp
>
> Hmm, now I see...
>
> Ehrm, not certain if no solution is possible and mention that quickly.
> If it's really only for 1 REAL AS-depth behind AS54, how about:
>
> ^54(_[0-9]+)\1*$ ?
>
> :)
>
> That would match from left to right:
>
> - Something starting with AS54
> - 0 or more instances of something having '_' (space) directly
> followed with a set of [0-9] digits immediately behind
> - And now comes the trick... The '\1' indicates that it should match
> (ONLY) exactely again what it found in the last match between round
> brackets with the '*' that it should do this 0 or more times...
>
> It can be that for that last one you also need the '\1' between round
> brackets, but would need to check that out in the cmd-reference for
> regexp's... But this is what it comes down to...
> (So in that case: ^54(_[0-9]+)(\1)*$ )
>
> But check it out yourself, my last bookmark on this was:
> http://www.cisco.com/en/US/products/sw/iosswrel/ps1828/products_comman
> d_refe
> rence_chapter09186a00800ca541.html
>
> I'd say, paste it into a few lab-routers and check it out... Either
> with or without the round brackets it should work...
>
>
> Cya
>
> Rene.
>
>
> P.S.
>
> Even if it's wrong, I'd say 2 points for creativity... ;)
>
>
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> Of Bit Gossip
> Sent: Wednesday, December 27, 2006 9:29 PM
> To: ccielab@groupstudy.com
> Subject: RE: BGP Reg Exp
>
> Hi Rene, GS,
> the original pb was: match all route of AS54 and its directly attached
> customers, where a customer could prepend once or more The trick here
> is that you don't know the AS of the customer before hand, so I agree
> that unless you list all possible ASs, there is no solution for this
> problem with a regular expression....
> Luca.
>
>
> On Wed, 2006-12-27 at 20:48 +0100, Huizinga, Rene wrote:
> > Hi Luca,
> >
> >
> > Not certain if I understand your question correctly, but if you want
> > to accept all, with AND without prepending, try:
> >
> > ^54(_1234)+_
> >
> > Or ONLY when prepended:
> >
> > ^54(_1234)*_1234_
> >
> > In my understanding, this should be correct, correct me if I'm wrong
> > or please explain your question in case of misunderstandings...
> >
> >
> > Cya
> >
> > Rene.
> >
> > -----Original Message-----
> > From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> > Of Bit Gossip
> > Sent: Wednesday, December 27, 2006 8:23 PM
> > To: ccielab@groupstudy.com
> > Subject: RE: BGP Reg Exp
> >
> > I was wandering if it is possible to make the expression smarter so
> > that it can cope with the customer prepending once or more time;
> > something
> > like:
> > 54 1234 1234 1234
> > but not like
> > 54 1234 4321
> >
> > I couldn't come to any solution....
> >
> > Luca.
> >
> > On Wed, 2006-12-27 at 09:11 -0500, Scott Morris wrote:
> > > Both will work. Yours does 0 or more of the single character 0-9.
> > > The first does one or more, but makes the whole thing optional
> > > with the ? (0 or
> > > 1 of preceeding).
> > >
> > > Different logic, same result!
> > >
> > >
> > > Scott Morris, CCIE4 (R&S/ISP-Dial/Security/Service Provider)
> > > #4713, JNCIE #153, CISSP, et al.
> > > CCSI/JNCI-M/JNCI-J
> > > IPExpert VP - Curriculum Development IPExpert Sr. Technical
> > > Instructor smorris@ipexpert.com http://www.ipexpert.com
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On
> > > Behalf Of JB
> > > Sent: Wednesday, December 27, 2006 4:59 AM
> > > To: ccielab@groupstudy.com
> > > Subject: BGP Reg Exp
> > >
> > > Hi all, question asks for a router to accept prefixes from BB1
> > > that have been originated by themselves and their directly
> > > connected
> customers.
> > >
> > > Solution says: ^54(_[0-9]+)?$
> > >
> > > I got ^54_[0-9]*$.
> > >
> > > I ran mine thru looking-glass and it "seems" to work. I would
> > > appreciate it if someone could explain the differences, if any,
> > > between the two to further my understanding.
> > >
> > > TIA,
> > >
> > > JB
> > >
> > > __________________________________________________________________
> > > __ __ _ Subscription information may be found at:
> > > http://www.groupstudy.com/list/CCIELab.html
> > >
> > > __________________________________________________________________
> > > __ __ _ Subscription information may be found at:
> > > http://www.groupstudy.com/list/CCIELab.html
> >
> > ____________________________________________________________________
> > __ _ Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
>
> ______________________________________________________________________
> _ Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
> ______________________________________________________________________
> _ Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
This archive was generated by hypermail 2.1.4 : Tue Jan 02 2007 - 07:50:39 ART