From: ccie candidate (ccie1@xxxxxxxxx)
Date: Mon Aug 19 2002 - 04:11:42 GMT-3
i didnt get your exact question ..however if you want to match a string that ha
s for example AS 500 somewhere in the path ...
simplest way is _500_ will match
--On Mon, 19 Aug 2002 11:53:51 Khalid Siddiq wrote: >Hi, >This regular expersion is for the AS connected directly to our AS, what happen if the AS is not directly connected? >can we used the same regular expression, i don't think. >can someone have any idea about that. >regards, >khalid > >-----Original Message----- >From: ccie candidate [mailto:ccie1@lycos.com] >Sent: Monday, August 19, 2002 9:32 AM >To: 'Omer Ansari'; Michael Snyder >Cc: ccielab@groupstudy.com >Subject: RE: Filtering BGP updates using ip as-path access-lists > > >guys ; > >i want to participate in this > >regular experssions are actually work with the Finite state machine concept .. it means that when you want to have a match ..the conditios must come in the pr ovided sequence of the regular expression > > >to explain this lets take Michael question ..is 4 is the same ^4$ ..the answer is absolutely NOT. > >the first one (^4$) tells the router that the strings that will match me (the expression ) should be like that >"when they start with begining of the string , >it should follow that the number 4 , then it should follow with end of the lin e " > >now only AS path of 4 will match ,no other strings can fit or match here > >i think that one is clear . > >now about the second regular expression ..it actually tells the router nothing more than >" if the number 4 appears in the string , this is a match !! " > >so strings like 49 , 354 , 12 4 5 >will all match > > >this will explain also why expression like _2_ means to match AS paths that co ntains 2 >the expression says >" when space(or begining of line) followed by 2 followed by space (or end of l ine )appears ..this is a match " > >so strings like 33 2 44 , 2 , 13 2 will all match . > > >now to some of the expressions mentioned in the previous posts > >[0-9]* will match the null string >(* means zero or more of the occurence) > >so the regular expression >^4 [0-9]*$ will match AS 4 and any other AS attached to it ...the only thing w hich i have to test is the space if it match the space of not ..i will come bac k with that soon .. > > > >i hope this help > > > > > > >-- > >On Sun, 18 Aug 2002 19:43:47 > Michael Snyder wrote: >>I wouldn't say that the expression nullifies routes from as4. Routes >>originating from AS4 would only have the string ^4$. The expression in >>question ^4 [0-9]* [0-9]*$ requires that only paths that start with as4 >>and have two more wildcard paths will match. >> >>I don't believe [0-9]* will match a null string. Therefore there's a >>problem with my string I didn't see before, the problem is that isn't >>inclusive of paths that are only one or two AS's long. >> >>If my requirement was to get the directly connected neighbors of AS4, >>and those directly connected to the neighbors, then I think I would need >>three expressions. >> >>^4$ ; Need a path to AS4 >>^4 [0-9]*$ ; Need AS4's neighbors >>^4 [0-9]* [0-9]*$ ; Need AS4's neighbor's neighbors >> >>About when to us a space char (ascii 32) vs using an underscore _ (acsii >>95), I just use my own experience. After reading the BGP tables for a >>few months during labs, I know what string I want to match. >> >>Your last question about confederations, they use braces. Acsii 123,125 >> >>Don't think I've seen a comma in an AS path yet. >> >>Your question, has brought another question to my mind. Wonder if ^4$ >>and 4 would do the same thing. I'll lab it this week. >> >> >>-----Original Message----- >>From: Omer Ansari [mailto:omer@ansari.com] >>Sent: Sunday, August 18, 2002 12:08 PM >>To: Michael Snyder >>Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com >>Subject: RE: Filtering BGP updates using ip as-path access-lists >> >>Mike, >>the spaces in your regexp automatically nullify any routes originating >>from AS4 right? >> >>a little digression: anyone care to explain the difference between a >>comma >>(,) and a space ( ) in a regexp? >> >>are commas there for confederations? >> >> >> >>On Thu, 15 Aug 2002, 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:29 GMT-3