Technology: Routing
Area: EGP
Vendor: Cisco
Title: BGP aggregation
Software: 12.X , 15.X, IP Services
Platform: Catalyst 3560, 3750, 3850, 4500, 6500, ISR/ASR Routers
BGP community stands for the attributes which can easily be added to the group of prefixes to marked them with the same meaning. With that possibility we can manipulate the whole bunch of prefixes base on single tag which is transitive across BGP autonomous systems.
There are four well-known communities values (https://tools.ietf.org/html/draft-ietf-idr-wide-bgp-communities-04):
To configure router R1 to send prefix marked with community:
R1# configure terminal
R1 (config)# ip bgp- community new-format
R1 (config)# route-map COMMUNITY permit 10
R1 (config-route-map)# set community 100:999
R1 (config)# router bgp 100
R1 (config-router)# network 94.70.40.0 mask 255.255.255.0 route-map COMMUNITY
R1 (config-router)# neighbor 80.50.0.2 remote-as 200
R1 (config-router)# neighbor 80.50.0.2 send-community
R1 (config-router)# exit
R2# configure terminal
R2 (config)# ip bgp-community new-format
R2 (config)# router bgp 200
R2 (config-router)# neighbor 80.50.0.1 remote-as 100
R2 (config-router)# exit
Verification commands:
R1# show bgp ipv4 unicast neighbors 80.50.0.2 | i Community
BGP Community attribute sent to this neighbor
R2# show bgp ipv4 unicast 94.70.40.0/24
BGP routing table entry for 94.70.40.0/24, version 6
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
100
80.50.0.1 from 80.50.0.1 (80.50.0.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 100:999
To configure router R2 to match on specific community and change the prefixes preference:
R2# configure terminal
R2 (config)# ip community-list 10 permit 100:999
R2 (config)# route-map R1_IN permit 10
R2 (config-route-map)# match community 10
R2 (config-route-map)# set local-preference 150
R2 (config)# router bgp 200
R2 (config-router)# neighbor 80.50.0.1 route-map R1_IN in
R2 (config-router)# exit
R2# show bgp ipv4 unicast 94.70.40.0/24
BGP routing table entry for 94.70.40.0/24, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
100
80.50.0.1 from 80.50.0.1 (80.50.0.1)
Origin IGP, metric 0, localpref 150, valid, external, best
Community: 100:999