Defining a community ACL

A BGP community ACL can be configured, and BGP community attributes set in a route map instance.
  1. Enter the configure terminal command to access global configuration mode.
    device# configure terminal
  2. Enter the ip community-list extended command using the permit keyword to configure a BGP community ACL.
    device(config)# ip community-list extended 1 permit ^[1-2]23
  3. Enter the route-map name command to create and define a route map and enter route map configuration mode.
    device(config)# route-map ComRmap permit 10
  4. Enter the match community command and specify a community list name.
    device(config-route-map-ComRmap)# match community 1
  5. Enter the set community command to set the BGP community attributes.
    device(config-route-map-ComRmap)# set community 323:1 additive
  6. Enter the exit command to return to global configuration mode.
    device(config-route-map-ComRmap)# exit
  7. Enter the route-map name command to define a route map and enter route map configuration mode.
    device(config)# route-map sendComRmap permit 10
  8. Enter the set community command to set the BGP community attributes.
    device(config-route-map-sendComRmap)# set community  3:3

The following example configures a BGP community ACL and sets the BGP community attributes in a route map instance.

device# configure terminal
device(config)# ip community-list extended 1 permit ^[1-2]23
device(config)# route-map ComRmap permit 10
device(config-route-map-ComRmap)# match community 1
device(config-route-map-ComRmap)# set community 323:1 additive
device(config-route-map-ComRmap)# exit
device(config)# route-map sendComRmap permit 10
device(config-route-map-sendComRmap)# set community  3:3