Re: [j-nsp] Community RegEx

2009-09-04 Thread Richard A Steenbergen
On Fri, Sep 04, 2009 at 01:35:53PM -0400, Eric Van Tol wrote:
> A private response (thanks, Chris!) indicates to me that the following two 
> are actually correct:
> 
> ^1234:((100)|(250)|(375))$
> ^1234:(100|250|375)$
> 
> My other example "works", but also matches on other patterns such as 999:250, 
> 38549:250, and 7:100:
> 
> ^1234:(100)|(250)|(375)$

Oh, duh, yes I wasn't even paying attention to that part I thought your
question was just about the external parens. To do that "or" you want
(123|234|345), the additional parens around the individual items are
what is unnecessary. And of course you need the ^ $ to protect the begin
and end, otherwise you'd match 1234 as well as 11234, etc, etc.

-- 
Richard A Steenbergenhttp://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] Community RegEx

2009-09-04 Thread Eric Van Tol
> -Original Message-
> From: Richard A Steenbergen [mailto:r...@e-gerbil.net]
> Sent: Friday, September 04, 2009 11:26 AM
> To: Eric Van Tol
> Cc: juniper-nsp@puck.nether.net
> Subject: Re: [j-nsp] Community RegEx
> 
> On Fri, Sep 04, 2009 at 07:52:35AM -0400, Eric Van Tol wrote:
> >
> > I would think that the first one is the way to go, but it appears that
> > both work.  Is one a "more righter" way of defining these communities?
> 
> Thats like asking which of the following two math expressions is "more
> right":
> 
> A+B+C or (A+B+C)
> 
> Both say the same thing, the extra ()s on the second are unnecesary
> because you aren't doing anything else with the expression in which the
> parenthesis change the order of the operations. Now, if you were to
> later come along and add "* 2" to the expression it would suddenly make
> a difference to the result. But I doubt you would argue that you should
> always put all of your existing expressions inside unnecessary parens
> all the time, just incase someone were to come along and reuse your
> A+B+C snippit in another expression without fully understanding how math
> works. :)
> 
> --
> Richard A Steenbergenhttp://www.e-gerbil.net/ras
> GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)

A private response (thanks, Chris!) indicates to me that the following two are 
actually correct:

^1234:((100)|(250)|(375))$
^1234:(100|250|375)$

My other example "works", but also matches on other patterns such as 999:250, 
38549:250, and 7:100:

^1234:(100)|(250)|(375)$

-evt
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] Community RegEx

2009-09-04 Thread Richard A Steenbergen
On Fri, Sep 04, 2009 at 07:52:35AM -0400, Eric Van Tol wrote:
> 
> I would think that the first one is the way to go, but it appears that
> both work.  Is one a "more righter" way of defining these communities?

Thats like asking which of the following two math expressions is "more 
right":

A+B+C or (A+B+C)

Both say the same thing, the extra ()s on the second are unnecesary
because you aren't doing anything else with the expression in which the
parenthesis change the order of the operations. Now, if you were to
later come along and add "* 2" to the expression it would suddenly make
a difference to the result. But I doubt you would argue that you should
always put all of your existing expressions inside unnecessary parens
all the time, just incase someone were to come along and reuse your
A+B+C snippit in another expression without fully understanding how math
works. :)

-- 
Richard A Steenbergenhttp://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] Community RegEx

2009-09-04 Thread Eric Van Tol
> -Original Message-
> From: Paul Stewart [mailto:p...@paulstewart.org]
> Sent: Friday, September 04, 2009 8:02 AM
> To: Eric Van Tol; juniper-nsp@puck.nether.net
> Subject: RE: [j-nsp] Community RegEx
> 
> Probably the real question is what you wish to accomplish with communities
> -
> do you want to use them just for marking "interesting info" or do you want
> to use them for filtering?  You can also take them to the point of
> allowing
> your downstream BGP customers to influence their traffic through your
> network...
> 
> Communities are very cool in my opinion - but you need a good "plan of
> attack" for utilizing them to save yourself headaches..;)
> 
> Paul

Hi Paul,
Thanks for the response.  We already have a pretty complex community policy, 
which allows for downstream filtering and also allows our customers to set 
attributes for their prefixes both within our network and upstream from us.  Is 
there a difference between the two ways to define these communities that works 
better for one "plan of attack" than another?  I wouldn't think so, but it 
wouldn't be the first time I was wrong about something like this.

-evt
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


Re: [j-nsp] Community RegEx

2009-09-04 Thread Paul Stewart
Probably the real question is what you wish to accomplish with communities -
do you want to use them just for marking "interesting info" or do you want
to use them for filtering?  You can also take them to the point of allowing
your downstream BGP customers to influence their traffic through your
network...

Communities are very cool in my opinion - but you need a good "plan of
attack" for utilizing them to save yourself headaches..;)

Paul


-Original Message-
From: juniper-nsp-boun...@puck.nether.net
[mailto:juniper-nsp-boun...@puck.nether.net] On Behalf Of Eric Van Tol
Sent: September-04-09 7:53 AM
To: juniper-nsp@puck.nether.net
Subject: [j-nsp] Community RegEx

Hi all,
I'm having some trouble identifying the proper way to define some
communities.  I've read this:

http://www.juniper.net/techpubs/software/junos/junos94/swconfig-policy/confi
guring-the-community-attribute-using-unix-regular-expressions.html

but still have questions.  Let's say I have three communities 1234:100,
1234:250, and 1234:375.  According to the docs, it appears they should be
defined as such:

^1234:((100)|(250)|(375))$

However, I have several community definitions that seem to work in the
following format:

^1234:(100)|(250)|(375)$

I would think that the first one is the way to go, but it appears that both
work.  Is one a "more righter" way of defining these communities?

-evt 

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


[j-nsp] Community RegEx

2009-09-04 Thread Eric Van Tol
Hi all,
I'm having some trouble identifying the proper way to define some communities.  
I've read this:

http://www.juniper.net/techpubs/software/junos/junos94/swconfig-policy/configuring-the-community-attribute-using-unix-regular-expressions.html

but still have questions.  Let's say I have three communities 1234:100, 
1234:250, and 1234:375.  According to the docs, it appears they should be 
defined as such:

^1234:((100)|(250)|(375))$

However, I have several community definitions that seem to work in the 
following format:

^1234:(100)|(250)|(375)$

I would think that the first one is the way to go, but it appears that both 
work.  Is one a "more righter" way of defining these communities?

-evt 

___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp