[c-nsp] match multiple communities in route-map

Andy BIERLAIR andy.bierlair at root.lu
Tue Mar 24 13:38:59 EDT 2009


Hi Mike,

Actually I need both conditions set, because the community-list PREPEND-X-PEERING may contain prefixes that we don't want to announce to our peerings, that is why I was looking for some sort of AND logic here.

A real-life example with ASN 1234 would be:

Customer sends us three prefixes:

1.0.0.0/8 with community 64700:3
2.0.0.0/8 without community
3.0.0.0/8 with community 64700:2

With an inbound route-map we tag the first two prefixes with additive communities:

1234:3000 (customer prefix)
1234:3001 (customer 1)
1234:7000 (route learned in Europe)
1234:7003 (route learned in Germany)

The last prefix is only tagged: 1234:9999 (bogon route)

Definition of PEERING-OUT (tag customers from EUROPE):

ip community-list expanded PEERING-OUT permit 1234:3000
ip community-list expanded PEERING-OUT permit 1234:7000

In your scenario 3.0.0.0/8 would be announced to our peers, but would not be part of PEERING-OUT.


Policy-list was mentionned here, but they don't seem to support expanded community-lists.

I hope you get the idea of what I am trying to do.

Thanks.

-
Andy

-----Original Message-----
From: Michael K. Smith - Adhost [mailto:mksmith at adhost.com] 
Sent: Tuesday, March 24, 2009 17:05
To: Andy BIERLAIR; cisco-nsp at puck.nether.net
Subject: RE: [c-nsp] match multiple communities in route-map

Hello Andy:

I don't think you want the two match-community statements in your first two route-map statements.  So, that would be:
> 
> route-map IX-TEST-OUT permit 10
>   match community PREPEND-1-PEERING
--   match community PEERING-OUT
>   set as-path prepend 65001
> 
> route-map IX-TEST-OUT permit 20
>   match community PREPEND-2-PEERING
--   match community PEERING-OUT
>   set as-path prepend 65001 65001
> 
> route-map IX-TEST-OUT permit 30
>   match community PEERING-OUT
> 

Also, you might want to confirm you're seeing the right stuff in your community sets using the "sho ip bgp community-list PEERING-OUT|PREPEND-1-PEERING, etc.

Regards,

Mike



More information about the cisco-nsp mailing list