Apply a BGP4 Extended Community Filter

  1. Access global configuration mode.
    device# configure terminal
  2. Define the matching conditions for the extended community.
    device(config)# ip extcommunity-list 1 permit rt 123:2
    This example specifies that community list 1 permits routes from network 2 in autonomous system 123.
  3. Access BGP configuration mode.
    device(config)# router bgp
  4. Specify the autonomous system in which your device resides.
    device(config-bgp-router)# local-as 1000
  5. Specify the autonomous system in which the remote neighbor resides.
    device(config-bgp-router)# neighbor 10.1.2.3 remote-as 1001
  6. Access IPv4 address family configuration mode.
    device(config-bgp-router)# address-family ipv4 unicast
  7. Enable the exchange of information with the neighbor.
    device(config-bgp-ipv4u)# neighbor 10.1.2.3 activate
  8. Apply a route map to incoming routes.
    device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map in extComRmapt 
    This example uses the in keyword to apply route map extComRmapt.
  9. Apply a route map to outgoing routes.
    device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map out sendExtComRmap 
    This example uses the out keyword to apply route map sendExtComRmap.
  10. Enable the sending of standard and extended attributes in updates to the specified BGP neighbor.
    device(config-bgp-ipv4u)# neighbor 10.1.2.3 send-community both
    This example uses the send-community both keywords.

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