Lets take this basic topology:

RTR A ---- RTR B

Routers A and B have an eBGP connection.

At router B we can have a route map saying:

match: community-list xyz
action: permit/deny etc


  • How was the community xyz tagged at router A in the first place?

  • For eg. If router A has a directly connected or static route, it is advertising to router B, will that route be tagged with the community?

  • How does router A decide which routes to tag with a community tag How can we say "tag all routes before advertising"

In arista we initiate a commununity list as: ip community-list permit blah 1223:12323

  • What does this statement really do (Just the statment alone, without any adding/using it in any route maps)?
  • Does this statement mean we will tag all routes with community blah
  • You need to use a route map to set the community, either outbound from the advertising AS, or inbound at the receiving AS. You can use a community list in a route map. You also need to make sure that the receiving AS actually allow communities from the other AS to even be able to use them in the destination AS.
    – Ron Maupin
    May 20, 2021 at 22:36
  • Did any answer help you? if so, you should accept the answer so that the question does not keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer.
    – Ron Maupin
    Dec 23, 2021 at 19:22

1 Answer 1


Communities are usually applied to prefixes via route-maps. In your example, RouterA may have something like this:

route-map to-router-b permit 10
 description Tag Prefixes with Community
 match ip address prefix-list my-prefixes
 set community 65530:1234 additive

The above will add an additional BGP community to the prefix on egress to RouterB (presuming the above route-map is set on the RouterB neighbour).

One thing to note is that communities are always manual (minus extended communities and some edge cases), this means that any prefix that ends up with a BGP Community has traversed somewhere that has a manually created route map.

Re: your second question, by default these will not be tagged with any communities however, the easiest way to do this is to apply a route map to the redistribute connected and redistribute static statements under the BGP hierachy like so:

router bgp 65530
  address-family ipv4
    redistribute connected route-map tag-with-community
    redistribute static route-map tag-with-community

route-map tag-with-community permit 10
  match ip address prefix-list my-prefixes
  set community 65530:1111

My knowledge of Arista is minimal but if its anything like Cisco then a community-list won't do anything unless applied specifically to a route map or similar. Community lists can be handy when handling large sums of Communities. For example, say I decided to tag all of my internal prefixes with something like 65530:111X where X is a different digit per geographical location, I could create a community list to include the following:

ip community-list expanded All-My-Prefixes permit _65530:111._

This would then match all of my internal prefixes regardless of the last digit.

  • Perfect.. Thank you for answering. So lets say I want to apply an outbound community to ALL prefixes. Even in that case, I ll need a prefix list (even if that prefix list does nothing else but permit everything. eg permit And secondly, there is no way to say to a router "tag this everywhere" without using a route map ?
    – john
    May 21, 2021 at 5:07
  • 1
    @john, That's correct, you could use however when dealing with BGP it is always recommended to be as specific as possible! The best way to "tag this everywhere" would be to use a route-map on the point where you redistribute the route into BGP, e.g. via static/connected you can use the above example to apply a community on ingress to the BGP RIB.
    – ditrapanij
    May 22, 2021 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.