From: Huizinga, Rene (rhuizinga@upcbroadband.com)
Date: Thu Dec 28 2006 - 23:59:21 ART
Hi Scott,
Hmmm, I see your point...Sounds logic. Let's see what the result is...:
sh ip bgp regexp _174(_[0-9]+)\1*$
*>i63.210.16.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.210.17.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.210.18.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.210.19.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.210.20.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.210.21.0/24 213.46.161.250 0 250 0 174 32479 i
*>i63.211.131.0/24 213.46.161.250 0 250 0 174 32348 i
*>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
Hmmm, this one seems to have 2 issues. One is the still incorrect path, the
other the fact that now I only get results with a double as-path or longer !
:| Logic because the first match within round bracket's and the '+' is a
'must-match', the '\1' with trailing '*' because of this optional... And
that wasn't the question. This was to allow BOTH the peering-AS prefixes (in
the sample because of a full-table, taken AS174 (Cogent)) as well as their
directly connected customer-AS'es.
When comparing this output with the one of: 'sh ip bgp regexp _174$' I see
the prefixes in there with a single AS-path missing in this output...:|
Either the engine isn't working properly, or we're still bugging around.. :)
But also the alternative I tried and posted, the:
sh ip bgp regexp _174_([0-9]*_)\1*$
Isn't working properly...and this one doesn't have the issue you mentioned
c.q. allows the AS behind 174 to be non-existent. Yes, the router would with
interpreting the result hit a '_174__$' in the end, so 2x '_' before getting
the '$' but that shouldn't (!) be a problem normally... But one could also
see prefixes with just the single 174 in that output...
But let's put it different, what do YOU believe is the expression that
should work and one could test ?
Cya
Rene.
-----Original Message-----
From: Scott Morris [mailto:swm@emanon.com]
Sent: Friday, December 29, 2006 3:41 AM
To: 'Bit Gossip'; 'Huizinga, Rene'
Cc: ccielab@groupstudy.com
Subject: RE: BGP Reg Exp
It will stop being erratic if you remove the second to last *. :) 'cause
otherwise you're allowing multiples of AS numbers (including that _
character)....
HTH,
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 Bit
Gossip
Sent: Thursday, December 28, 2006 5: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