Applying a BGP extended community filter

A BGP extended community filter can be applied.
  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 local-preference command and specify a value to set a BGP local-preference path attribute.
    device(config-route-map-ComRmap)# set local-preference 200
  6. Enter the router bgp command to enable BGP routing.
    device(config)# router bgp
  7. Enter the local-as command to configure the autonomous system number (ASN) in which your device resides.
    device(config-bgp-router)# local-as 1000
  8. Enter the neighbor ipv6-address remote-as command to specify the ASN in which the remote neighbor resides.
    device(config-bgp-router)# neighbor fe80:4398:ab30:45de::1 remote-as 1001
  9. Enter the neighbor ipv6-address update-source command to specify an interface.
    device(config-bgp-router)# neighbor fe80:4398:ab30:45de::1 update-source ve 1000
  10. Enter the address-family command and specify the ipv6 and unicast keywords to enter IPv6 address family configuration mode.
    device(config-bgp-router)# address-family ipv6 unicast
  11. Enter the neighbor ipv6-address activate command to enable the exchange of information with the neighbor.
    device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 activate
  12. Enter the neighbor ipv6-address route-map command and specify the in keyword to apply a route map to incoming routes.
    device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 route-map in ComRmap 
  13. Enter the neighbor ipv6-address send-community command to enable the sending of standard and extended attributes in updates to the specified BGP neighbor.
    device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 send-community

The following example applies a BGP extended community filter.

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 local-preference 200
device(config)# router bgp
device(config-bgp-router)# local-as 1000
device(config-bgp-router)# neighbor fe80:4398:ab30:45de::1 remote-as 1001
device(config-bgp-router)# neighbor fe80:4398:ab30:45de::1 update-source ve 1000  
device(config-bgp-router)# address-family ipv6 unicast
device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 activate
device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 route-map in ComRmap 
device(config-bgp-ipv6u)# neighbor fe80:4398:ab30:45de::1 send-community