You can apply an extended community filter to a neighbor through a route map.
device# configure terminal
device(config)# ip extcommunity-list 1 permit rt 123:2
device(config)# router bgp
device(config-bgp-router)# local-as 1000
device(config-bgp-router)# neighbor 10.1.2.3 remote-as 1001
device(config-bgp-router)# address-family ipv4 unicast
device(config-bgp-ipv4u)# neighbor 10.1.2.3 activate
device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map in extComRmapt
device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map out sendExtComRmap
device(config-bgp-ipv4u)# neighbor 10.1.2.3 send-community both
The following example summarizes the commands in this procedure.
device# configure terminal device(config)# ip extcommunity-list 1 permit rt 123:2 device(config)# router bgp device(config-bgp-router)# local-as 1000 device(config-bgp-router)# neighbor 10.1.2.3 remote-as 1001 device(config-bgp-router)# address-family ipv4 unicast device(config-bgp-ipv4u)# neighbor 10.1.2.3 activate device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map in extComRmapt device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map out sendExtComRmap device(config-bgp-ipv4u)# neighbor 10.1.2.3 send-community both