BGP communities attribute is widely used for implementing policy
routing. Network operators can manipulate BGP communities attribute
based on their network policy. BGP communities attribute is defined
RFC1997 - BGP Communities Attribute and
RFC1998 - An Application of the BGP Community Attribute
in Multi-home Routing. It is an optional transitive attribute,
therefore local policy can travel through different autonomous system.
Communities attribute is a set of communities values. Each communities value is 4 octet long. The following format is used to define communities value.
ASis high order 2 octet in digit format.
VALis low order 2 octet in digit format. This format is useful to define AS oriented policy value. For example,
7675:80can be used when AS 7675 wants to pass local policy value 80 to neighboring peer.
internetrepresents well-known communities value 0.
no-exportrepresents well-known communities value
no-advertiserepresents well-known communities value
local-ASrepresents well-known communities value
NO_EXPORT_SUBCONFED(0xFFFFFF03). All routes carry this value must not be advertised to external BGP peers. Even if the neighboring router is part of confederation, it is considered as external BGP peer, so the route will not be announced to the peer.
When BGP communities attribute is received, duplicated communities value in the communities attribute is ignored and each communities values are sorted in numerical order.