A virtual private gateway is a logical, fully redundant distributed edge routing function that sits at the edge of your VPC. As it is capable of terminating VPN connections from your on-prem or customer environments, the VPG is the VPN concentrator on the Amazon side of the Site-to-Site VPN connection.
- Login to aws portal.
- Click on Services.
- Under Networking & Content Delivery select VPC.
- Click on Virtual Private Gateways.
- Click on Create Virtual Private Gateway.
- Provide Virtual Private Gateway Tag name.
- Select default amazon ASN.
- Click on Create Virtual private gateway.
- After sometime virtual private gateway is created successfully.
- Click on Close option then go to vgw console page.
- New Virtual private gateway is there with the tag name we provide.
- Click on Actions.
- Select Attach to VPC.
- Select existing VPC.
- Click on Yes Attach.
- Existing VPC is attached to Virtual private gateway.
Create Virtual Private Gateway using Shell
- Setup aws-cli on your system so click on link https://www.hackerxone.com/blog/how-install-configure-aws-cli-ubuntu-1804
- Run the following command:
To create a virtual private gateway
aws ec2 create-vpn-gateway –type ipsec.1
To create a virtual private gateway with a specific Amazon-side ASN
aws ec2 create-vpn-gateway –type ipsec.1 –amazon-side-asn 65001
To attach a virtual private gateway to your VPC
aws ec2 attach-vpn-gateway –vpn-gateway-id vgw-id –vpc-id vpc-id