BGP communities

A BGP community is bit of “extra information” that you can add to one of more prefixes that is advertised to BGP neighbors. This extra information can be used for things like traffic engineering or dynamic routing policies. There are 4 well-known BGP communities that you can use or you can pick a numeric value that you can use for your own policies.

Here are the 4 well-known BGP communities:

  • Internet: advertise the prefix to all BGP neighbors.
  • No-Advertise: don’t advertise the prefix to any BGP neighbors.
  • No-Export: don’t advertise the prefix to any eBGP neighbors.
  • Local-AS: don’t advertise the prefix outside of the sub-AS (used for BGP confederations).

All other communities use a 32-bit numerical value that is divided into two sections. Technically, this can be any value, but ISPs and administrators typically format it in a particular way to make it easer to use and remember. Specifically, the first 16 bits are used to indicate the AS number that originates the community, and the next 16 bits are assigned by the AS.

For example, a large ISP in the US uses these communities:

-------------------------------------------------------- customer traffic engineering communities - LocalPref -------------------------------------------------------- 3356:70 - set local preference to 70 3356:80 - set local preference to 80 3356:90 - set local preference to 90

The first 16 bits is their AS number (3356). This particular ISP has decided to use the second 16 bits to correspond to a local preference value (70, 80 and 90). On their routers they configured a policy that sets the local preference to these values if they receive prefixes with these BGP communities.

For the use of 12-byte large BGP communities, take a look at BGP - Large BGP communities.

https://networklessons.com/bgp/bgp-communities-explained