Table of Contents

AWS Managed VPN HowTo

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.

Getting Started

Before you can create a VPN you first need to create a VPC and modify some standard network settings.

Create VPC - Subnet and Modify Security Group

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.

Required On Premise and AWS Network Information

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.

Setup AWS Managed VPN

Create Customer Gateway

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

Create Virtual Private Gateway

You only have to do this once

Enable Route Propagation

Static Routing

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

Create VPN Connection

You have to do this for each VPN connection (Primary and Secondary)

Static Routing

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.

Download Configuration for Router (Configure Customer Gateway)

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.

Test the VPN Connection

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:

Troubleshooting

Nice to know

Keep these things in mind:

Identifying Active Tunnel

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.

Check AWS Network Propagation to On Premise Network

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.

Check On Premise Network Propagation to AWS

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”.

Resources

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