BGP communities are tags attached to routes that convey routing policy information between autonomous systems without altering the path attributes. They function as simple, standardized labels that allow network operators to signal desired traffic handling to upstream providers or internal network segments, enabling granular control over route propagation, path selection, and traffic engineering. Operators heavily rely on communities because they provide a more scalable and flexible method than manipulating AS paths or MEDs, allowing specific actions like regional prepending, blackholing, or influencing
peering preferences through agreed-upon values with
transit partners.
For example, to mitigate a
DDoS attack, you might tag a route with your provider's blackhole community:
route-map SET_COMMUNITY permit 10
set community 65530:666
This signals the provider to drop traffic to that
prefix. Another common use is influencing outbound path selection by prepending your AS only to specific neighbors:
route-map OUTBOUND permit 10
match community 123
set as-path prepend 64512 64512 64512
The underlying concept is that communities act as a policy language between BGP speakers, making them indispensable for large-scale traffic optimization and automated incident response.