BGP Communities in Practice
Let us analyze the illustration below provided by RENATER to explain how to use communities on its network. A dual-connected client network identifies a primary link and a secondary or backup link toward RENATER. In the BGP prefix announcements, this network can use the community
2200:610 on the primary link, and the community
2200:590 on the backup link. RENATER applies specific policies in order to implement the primary/backup behavior. A simple way to do this is described in the following:
- The client announces the prefix 10.1.2.0/24 with eBGP on the primary link toward NR-1 with a community attribute
- The client announces 10.1.2.0/24 on the backup link toward NR-2 with a community attribute
- RENATER receives the same prefix (with eBGP) with two different communities and applies the following policy when announcing the prefix inside its network with iBGP :
- If the community attribute matches 2200:610, the local preference attribute in the iBGP announcement is fixed to
- If the community attribute matches 2200:590, the local preference attribute in the iBGP announcement is fixed to
- Therefore, NR-1 announces 10.1.2.0/24 in iBGP with a local preference p whereas NR-2 announces the same prefix with a local preference
- By choosing p' (we can assume that
p = 610and
p' = 590), RENATER ensures that all its iBGP routers prefer the exit NR-1 to reach the client network and implement this information in their routing table.
With this configuration, all the traffic going to the client network is forwarded by RENATER on the primary link. Note that whenever this link goes down, the BGP selection process chooses the next best announcement (lower local preference) and forwards the traffic on the backup link.