How can I use BGP communities to influence the preferred routing path on Direct Connect links from AWS to my network?
Last updated: 2021-12-01
How can I use Border Gateway Protocol (BGP) communities to influence preferred routing path on AWS Direct Connect links from AWS to my network?
To configure private and transit virtual interfaces to prioritize which interface AWS uses to route traffic to your network, use the AS_PATH attribute. Direct Connect also supports local preference BGP community tags to control the route preference of traffic on private and transit virtual interfaces.
To configure private, public, and transit virtual interfaces to prioritize the interface AWS that uses to route traffic to your network, use the AS_PATH attribute. Direct Connect also supports local preference BGP community tags to control the route preference of traffic on virtual interfaces.
Note: Local preference BGP community tags are evaluated before the AS_PATH attribute.
Direct Connect supports the following local preference BGP communities:
- 7224:7100 Low preference
- 7224:7200 Medium preference
- 7224:7300 High preference
Local preference BGP community tags are evaluated in order from lowest to highest preference (where highest preference is preferred). For each prefix that you advertise over a BGP session, you can apply a community tag to indicate the priority of the associated path for returning traffic.
In this example:
- Two virtual interfaces A and B
- Advertising prefixes 10.10.10.0/24 and 10.20.20.0/24 to AWS
- You want virtual interface A to be preferred for traffic to network 10.10.10.0/24
- You want virtual interface B to be preferred for traffic to network 10.20.20.0/24
You can use local preference community tags:
- Apply higher preference tag 7224:7300 to prefix 10.10.10.0/24 on the BGP session in virtual interface A
- Apply higher preference tag 7224:7300 to prefix 10.20.20.0/24 on the BGP session in virtual interface B
- For private virtual interfaces, if you don't specify local preference using BGP community tags, then the default outbound routing behavior is based on the AWS Direct Connect locations relative distance to the originating Region. Routing behavior can't be influenced by Autonomous System (AS) prepending if the relative distance costs aren't equal. The lowest distance relative cost is evaluated before AS PATH prepending.
- To load balance traffic across multiple AWS Direct Connect connections, apply the same community tag across the prefixes for the connections.