Virtual Private Gateways association to Direct Connect Gateways in AWS
Tags: aws, awsnetworking, directconnect, awscommunity
Published: 2021-08-17 12:37:22

In this blog, I am explaining how to associate multiple virtual private gateways to single direct connect gateway in an AWS account.

Direct connect gateway gives you the option of associating multiple Virtaul Private Gateways(VGW) in an account to one direct connect gateway. When the direct connection established, it need to be consumed at AWS console either by VPG or by direct connect gateway. If you have multiple VPCs in the account and have multiple associated virtual gateways which need to be facilitated by one direct connect connection then direct connect gateway is the best option to manage this. Detailing below the steps to associate multiple VGWs to single direct connect gateway.

1. Create a Virtual Private Gateway.

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4x03qx92jlxo0z6xh62.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juojqnw2hopmruuh8a85.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4uvbrfjpdbwv5ydsbuy.png)

2. After you create the Virtual Private Gateway, it will be in the detach state, attach it or associate it with your VPC.

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx089uccekvbnna8pqwt.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byc0pckufw7gv1j7s85o.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wt0si46zkxbdoccwsky1.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukf1990sskueefbcvpd7.png)

3. After Virtual Gateway is attached to the VPC, create the direct connect gateway. Navigate to Direct Connect > Direct connect gateways and click on create direct connect gateways

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gscj193bq6rs3vtch3gb.png)

4. Mention some name for the direct connect gateway and provide Amazon side ASN with in the given rage. This range need to define between 64512–65534
 
    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajj9yuhottmk9ily3bg9.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2z67rki9mdcfh4c92f3h.png)

5. After direct connect gateway is created in your AWS account, it will show in the available state. Click on the gateway id and click the second tab gateway associations to associate your virtual gateway to the direct connect gateway.
    
    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63pp3l49bmyryv4k1l0n.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zsleepf2ejc77xcw19ns.png)

6. Click on the associate gateway and attach the virtual private gateway which you have created earlier and associated with VPC.
 
    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as1ibwabswmp7hi8f6by.png)

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ggwsom3hi2lnvyb5fiz.png)

7. Initially the page will show the status of associating and after 3–4 minutes, the state will change to associated. 

    ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1u615k2ntbqhdeiyi19x.png)


As given above in the steps, you can associate multiple virtual private gateway to single direct connect gateway in an account. Please note this association can happen only with in the account and not cross-accounts.