A community list is a sequential collection of permit and deny conditions. Each condition describes the community number to be matched. If you issued the ip bgp-community new-format command, the community number is in AA:NN format; otherwise it is in decimal format.
The router tests the community attribute of a route against the conditions in a community list one by one. The first match determines whether the router accepts (the route is permitted) or rejects (the route is denied) a route having the specified community. Because the router stops testing conditions after the first match, the order of the conditions is critical. If no conditions match, the router rejects the route.
Consider the network structure shown in Figure 27.
Figure 27: Community Lists

Suppose you want router Albany to set metrics for routes that it forwards to router Boston based on the communities to which the routes belong. You can create community lists and filter the routes with a route map that matches on the community list. The following commands demonstrate how to configure router Albany:
- host1(config)#router bgp 293
- host1(config-router)#neighbor 10.5.5.2 remote-as
32
- host1(config-router)#neighbor 10.2.2.1 remote-as
451
- host1(config-router)#neighbor 10.2.2.4 remote-as
17
- host1(config-router)#neighbor 10.2.2.4 route-map
commtrc out
- host1(config-router)#exit
- host1(config)#route-map commtrc permit 1
- host1(config-route-map)#match community 1
- host1(config-route-map)#set metric 20
- host1(config-route-map)#exit
- host1(config)#route-map commtrc permit 2
- host1(config-route-map)#match community 2
- host1(config-route-map)#set metric 75
- host1(config-route-map)#exit
- host1(config)#route-map commtrc permit 3
- host1(config-route-map)#match community 3
- host1(config-route-map)#set metric 85
- host1(config-route-map)#exit
- host1(config)#ip community-list 1 permit 25
- host1(config)#ip community-list 2 permit 62
- host1(config)#ip community-list 3 permit internet
Community list 1 comprises routes with a community of 25; their metric is set to 20. Community list 2 comprises routes with a community of 62; their metric is set to 75. Community 3 catches all remaining routes by matching the internet community; their metric is set to 85.
ip community-list
- host1(config)#ip community-list 1 permit 100:2
100:3 100:4
- host1(config)#route-map marengo permit 10
- host1(config-route-map)#match community 1
A route matches this community list only if it belongs to at least all three communities in community list 1: Communities 100:2, 100:3, and 100:4.
The router supports the new BGP extended community attribute. This attribute enables the definition of a new type of IP extended community and extended community list unrelated to the community list that uses regular expressions. BGP speakers can use the new extended community attribute to control routes similarly to the way it uses the community attribute. The extended community attribute is currently defined in the Internet draft, BGP Extended Communities Attribute—draft-ietf-idr-bgp-ext-communities-07.txt (February 2004 expiration).
![]() |
Note: IETF drafts are valid for only 6 months from the date of issuance. They must be considered as works in progress. Please refer to the IETF Web site at http://www.ietf.org for the latest drafts. |
ip extcommunity-list
- host1(config)#ip extcommunity-list boston1
permit 100:2 100:3 100:4
- host1(config)#route-map marengo permit 10
- host1(config-route-map)#match extcommunity
boston1
A route matches this community list only if it belongs to at least all three communities in extended community list boston1: Communities 100:2, 100:3, and 100:4.