I'm trying to create a VPN tunnel between 2 AWS regions. The way I'm trying to do this is by setting up a IPsec server in Linux with strongSwan in one region, and then a VPC VPN in the other region.
The problem is I can't come up with a configuration that works right.

AWS provides the following info for setting up the IPsec VPN:

#1: Internet Key Exchange Configuration

Configure the IKE SA as follows
  - Authentication Method    : Pre-Shared Key 
  - Pre-Shared Key           : ***********************
  - Authentication Algorithm : sha1
  - Encryption Algorithm     : aes-128-cbc
  - Lifetime                 : 28800 seconds
  - Phase 1 Negotiation Mode : main
  - Perfect Forward Secrecy  : Diffie-Hellman Group 2

#2: IPSec Configuration

Configure the IPSec SA as follows:
  - Protocol                 : esp
  - Authentication Algorithm : hmac-sha1-96
  - Encryption Algorithm     : aes-128-cbc
  - Lifetime                 : 3600 seconds
  - Mode                     : tunnel
  - Perfect Forward Secrecy  : Diffie-Hellman Group 2

IPSec Dead Peer Detection (DPD) will be enabled on the AWS Endpoint. We
recommend configuring DPD on your endpoint as follows:
  - DPD Interval             : 10
  - DPD Retries              : 3

IPSec ESP (Encapsulating Security Payload) inserts additional
headers to transmit packets. These headers require additional space, 
which reduces the amount of space available to transmit application data.
To limit the impact of this behavior, we recommend the following 
configuration on your Customer Gateway:
  - TCP MSS Adjustment       : 1387 bytes
  - Clear Don't Fragment Bit : enabled
  - Fragmentation            : Before encryption

#3: Tunnel Interface Configuration

Your Customer Gateway must be configured with a tunnel interface that is
associated with the IPSec tunnel. All traffic transmitted to the tunnel
interface is encrypted and transmitted to the Virtual Private Gateway.

The Customer Gateway and Virtual Private Gateway each have two addresses that relate
to this IPSec tunnel. Each contains an outside address, upon which encrypted
traffic is exchanged. Each also contain an inside address associated with
the tunnel interface.

The Customer Gateway outside IP address was provided when the Customer Gateway
was created. Changing the IP address requires the creation of a new
Customer Gateway.

The Customer Gateway inside IP address should be configured on your tunnel

Outside IP Addresses:
  - Customer Gateway                : 
  - Virtual Private Gateway         :

Inside IP Addresses
  - Customer Gateway                :
  - Virtual Private Gateway         :

Configure your tunnel to fragment at the optimal size:
  - Tunnel interface MTU     : 1436 bytes

#4: Static Routing Configuration:

To route traffic between your internal network and your VPC, 
you will need a static route added to your router.

Static Route Configuration Options:

  - Next hop       :

You should add static routes towards your internal network on the VGW.
The VGW will then send traffic towards your internal network over 
the tunnels.  

The private subnet on the local strongSwan side is
The private subnet on the remote VPN side is

With this I tried using a configuration as follows:

conn eu-west-1-1

However this results in the following error:

pluto[1763]: "eu-west-1-1" #12: cannot respond to IPsec SA request because no connection is known for[]...[]===

Following one idea I found on the strongSwan mailing list, I tried putting for the leftsubnet and rightsubnet, and this does cause the tunnel to come up (as reported by the AWS web GUI), but I lose all connectivity to the server (I'm guessing it's creating a route to that blackholes all traffic).

Can anyone provide any hints on how to adjust the config to get this working?

Yes, I know I can just use 2 strongSwan, OpenVPN, or other software VPN on both ends, but by using AWS's VPN functionality, I only have to worry about maintaining one end of the VPN instead of both.


I know it's been a while since you posted this, but I have done what you describe, here is a sample connection block using your values:

conn vpc1

Then you can do ipsec up vpc1 ; ipsec route vpc1.

Left is your local side, right is the Amazon VPC VPN side. Hopefully I've gotten the IP's right.

The problem is that the ipsec has to create the correct ip xfrm policy in the kernel, without the proper settings it will not know how to do the tunnel. That and the encryption settings have to be perfect.

It took me many attempts and finally working with strongswan devs to figure this one out. Caveats: This connection is not doing DPD properly, and sometimes drops. It also doesn't start+route when service ipsec start is called.

Good luck!

  • This is a great useful answer and helped me - thanks. – Aitch Dec 10 '13 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.