RE: BGP Regular Expression Question

From: Shine Joseph (shinepjoseph@iprimus.com.au)
Date: Tue Mar 11 2008 - 07:49:10 ARST


Phill,

Yes you are correct.
^1723(_[0-9]+)?$ matches 1723 and/or its directly connected AS.
^1723_[0-9]+$ matches only 1723 and its directly connected AS

Please see the example outputs below for more clarity.

R2#sh ip bgp reg ^100_[0-9]+$
   Network Next Hop Metric LocPrf Weight Path
*> 172.16.2.0/24 135.15.21.1 0 0 100 300 ?
*> 172.16.3.0/24 135.15.21.1 0 0 100 300 ?

R2#sh ip bgp reg ^100_([0-9]+)?$
   Network Next Hop Metric LocPrf Weight Path
*> 172.16.2.0/24 135.15.21.1 0 0 100 300 ?
*> 172.16.3.0/24 135.15.21.1 0 0 100 300 ?
*> 172.16.6.0/24 135.15.21.1 0 0 100 ?

HTH
Shine

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Phillip Day
Sent: Tuesday, 11 March 2008 8:01 PM
To: Timothy Chin; Mike Haddad; ccielab@groupstudy.com
Subject: RE: BGP Regular Expression Question

Perhaps I'm showing my rust with regular expressions, but wouldn't
^1723_[0-9]+$ match 1723 with one or more directly connected neighbors?
So then if a prefix came through which just originated in 1723 then it
would not be matched by the expression whereas it would be matched by
^1723(_[0-9]+)?$. Please feel free to correct me if I've misunderstood.

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Timothy Chin
Sent: 11 March 2008 06:23
To: Mike Haddad; ccielab@groupstudy.com
Subject: RE: BGP Regular Expression Question

The ? means zero or one instance and the + means one or more instances.
So if you use the () characters you are grouping the expression and
basically stating zero or one instance of that grouping. The second
expression basically states the same thing but without the grouping. You
would still get the same results: Any AS-Path beginning with 1723 and
ending with another AS number of any amount of characters.

Tim

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Mike Haddad
Sent: Tuesday, March 11, 2008 1:58 AM
To: ccielab@groupstudy.com
Subject: BGP Regular Expression Question

Is there any difference between the below:
^1723(_[0-9]+)?$ As 1723 and directly connected customers^1723_[0-9]+$
Does it
mean the same?

Thanks in advance,



This archive was generated by hypermail 2.1.4 : Tue Apr 01 2008 - 07:53:53 ART