[j-nsp] Match multiple bgp communities in a policy with AND condition

serge vautour sergervautour at gmail.com
Thu Apr 6 11:59:40 EDT 2017


IMHO whether you add a community to a policy term match statement or add a
community to a community members list, you still have to add the community
somewhere. I don't see how you get from 2x10 to 100.... Maybe I don't
understand the ask.

The only way I know how to get the AND logic to work in a single policy
term is to call another policy. This isn't tested but something like this:

[edit policy-options]
+   policy-statement communityb {
+       term term1 {
+           from community b;
+           then accept;
+       }
+   }
+   policy-statement xy {
+       term term1 {
+           from {
+               community a;
+               policy communityb;
+           }
+           then accept;
+       }
+   }
[edit policy-options]
+   community a members 123:1;
+   community b members 123:2;


I hope this helps.
Serge


On Thu, Apr 6, 2017 at 12:10 PM, "Rolf Hanßen" <nsp at rhanssen.de> wrote:

> Hello Serge,
>
> this works, but that is exactly the config I would like to avoid.
> In case of 2 communities this adds a third one, but in case of 2x 10
> communities that can be combined this adds 100 additional communities.
>
> kind regards
> Rolf
>
> > Hello,
> >
> > Have you tried this?
> >
> > set policy-options community MATCH2 members [ 123:1 123:2 ]
> >
> > I believe this will result in a logical AND.
> >
> > Serge
> >
>
>
>


More information about the juniper-nsp mailing list