Summary: How to setup a managed VPN into VPN.
Date: Around 2018
Refactor: 20 February 2025: Checked links and formatting.
This page shows some guidance in creating an AWS managed VPN. While configuring this I found the documentation sometimes lacking in information so that's why I created my own, including some troubleshooting and information on using BGP as well as static routing.
Note that this howto is about the amazon part. It does not cover the VPN setup in the on-premise datacenter.
Before you can create a VPN you first need to create a VPC and modify some standard network settings.
Create the VPC:
Create a Subnet:
Modify the security group to allow for ping, http, https, ssh and rdp:
Note that allowing these ports from all ip addresses is considered bad practice, even when it's not internet facing.
The thing with creating an AWS managed VPN is there are actually two parts. First you configure the amazon part on which you need some information about the on premise environment:
Note that the secondary On Premise VPN connection is not required to have a working VPN but if you'll use AWS for a longer period and for production you'll need a secondary connection in case of an emergency.
You have to repeat these steps for each customer gateway (primary and seconday). Note that the BGP ASN will (usually) be the same for both locations
You only have to do this once
For static routing you must manually enter the static routes used by your VPN connection. To do this, select your route table, choose Routes, Edit.
You only have to do this once
You have to do this for each VPN connection (Primary and Secondary)
If your VPN router does not support BGP, choose Static. For Static IP Prefixes, specify each IP prefix for the private network of your VPN connection.
This is not the route table, this is to tell the VPN which networks are allowed over the VPN. If a network is not listed the packets for these networks will be dropped.
For your network team to create the tunnels and the vpn they need quite some information. To provide all the correct information follow these steps:
Download the two files and provide them to your network team.
You should create an AWS Linux AMI 2 Instance within the VPC. Make sure it has the correct security group. After starting it it should get an IP address which you can ping.
In case the instance does not work you could make it reachable over the internet:
Keep these things in mind:
By doing a traceroute you can see which tunnel is being used. You can do a ping to any instance in AWS. If you do a traceroute it will show the Inside IP address of the tunnel on the on premise side. If you found that you can look into the tunnel settings in the VPN connection.
Again, by doing a traceroute you can check if the AWS network is being properly propagated to the on premise network. The trace will stop on the last address before the inside IP address of the tunnel on the on premise side. That means that the on premise network does not know the exact route. This mostly is caused that the route propagation is not being accepted on the on premise side.
If the on premise network is not properly propagating the networks it will show in the VPN Connections a few things differently than normal. The Status will show as DOWN and Details will show as “IPSEC UP”.
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario4.html
https://docs.aws.amazon.com/vpc/latest/userguide/SetUpVPNConnections.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html?icmpid=docs_ec2_console
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html