cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1262
Views
5
Helpful
3
Replies

BGP: Match Empty Standard Community

Does anyone know how to match on an empty standard BGP community list?

 

I'd like to filter out all routes that have at least one community configured and only advertise those without communities. I know how to do this with expanded communities, e.g. ip community-list expanded EMPTY permit ^$, but not sure how to achieve the same result with standard communities as standard community-lists do not support regular expressions.

 

Can anyone help?

1 Accepted Solution

Accepted Solutions

Dan Frey
Cisco Employee
Cisco Employee

This configuration works in my lab so only prefixes without a community tag are installed.

 

router bgp 10

bgp log-neighbor-changes

neighbor 192.168.0.20 remote-as 2

!

address-family ipv4

  neighbor 192.168.0.20 activate

  neighbor 192.168.0.20 route-map bgp in

exit-address-family

ip community-list standard EMPTY permit

route-map bgp permit 10

match community EMPTY exact-match

View solution in original post

3 Replies 3

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @Tymofii Dmytrenko ,

standard community lists look for an exact match, so I would say there is no way to match an empty or missing community attribute with standard community list.

you have found a way to match the routes using an expanded community-list if you can use it you are fine.

 

to be noted there is the set community none command in route-map but I don't think there is a match community none.

 

Hope to help

Giuseppe

 

Dan Frey
Cisco Employee
Cisco Employee

This configuration works in my lab so only prefixes without a community tag are installed.

 

router bgp 10

bgp log-neighbor-changes

neighbor 192.168.0.20 remote-as 2

!

address-family ipv4

  neighbor 192.168.0.20 activate

  neighbor 192.168.0.20 route-map bgp in

exit-address-family

ip community-list standard EMPTY permit

route-map bgp permit 10

match community EMPTY exact-match

That's perfect @Dan Frey

Thank you

 

To advertise directly attached subnets inc summaries I did this

 

ip community-list standard EMPTY permit
route-map into-MPLS permit 10
 description Local BGP Networks
 match community EMPTY exact-match
 match route-type local

 

As redistributed networks are ALL tagged with community in my case, this only advertises whatever I have injected with network statement or aggregate-address. Does what it says

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card