Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

How to setup an IPSec connection from my ubuntu laptop to Amazon EC2 instance? I tried setting it up using elastic IP and VPC with the following openswan configuration but it is not working.

conn host-to-host

    leftsubnet=EC2PRIVATEIP/32 # Local netmask
    right=1laptopip # Remote IP address
    ike=aes128 # IKE algorithms (AES cipher)
    esp=aes128 # ESP algorithns (AES cipher)
share|improve this question

2 Answers 2

Have you tried http://elasticemail.com/post/debianubuntu-tutorial-for-elastic-email? This might be an alternative to Amazon EC2 which I understand has very little support.

Debian/Ubuntu nullmailer with ElasticEmail

This tutorial is aimed to use nullmailer to relay all local email to the ElasticEmail cloud. This is useful if you don't want to rewrite your applications to use the API but want to use the awesome cloud delivery network of ElasticEmail.

Note: Nullmailer is a superb sendmail replacement with ElasticEmail. If an application wants to use SMTP directly however, it needs to be configured for ElasticEmail directly. Nullmailer only replaces sendmail and does not provide a local SMTP daemon.

To install nullmailer, use the following command. This will suggest to remove your previous installed mailer (exim4, postfix, etc.) but not purge it (so config files remain – if you want).

sudo apt-get install nullmailer

While installing, debconf should pop-up. If debconf does not pop-up, you can use the configfiles in /etc/nullmailer later. The corresponding config files are listed with each dialogue.

The first dialogue asks for your mail-name of the system (config file: /etc/mailname). The default should work here, otherwise enter your hostname and choose "Ok". The next dialogue asks for the smarthost to use for delivery (config file: /etc/nullmailer/remotes), which is ElasticEmail obviously, enter the following:

smtp.elasticemail.com smtp --port=2525 --user=YOURUSERNAME --pass=YOURAPIKEY

In the last dialogue you can configure the delivery of local messages (config file: /etc/nullmailer/adminaddr), like "somebody@localhost" which ElasticEmail would not be able to deliver. Enter a suitable email address for this case here.

If nullmailer was not automatically started, use the following command:

sudo /etc/init.d/nullmailer start

If you change the configfiles, use the following command to restart nullmailer:

sudo /etc/init.d/nullmailer restart

To test the delivery, use the commandline "mail"-tool (make sure the package "mailutils" is installed):

mail -s "test subject" you@youremailaddress.com

and follow the instructions (enter message, finish with Ctrl+D). Check the ElasticEmail interface and your inbox if everything went ok.

© Copyright Thomas Lutz www.clickforknowledge.com

share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Imagine the linked site goes down for maintenance or forever - your answer would become worthless. –  htorque Oct 31 '11 at 22:34
Thank you htorque, I will modify my answer a bit to have it in-line. –  finny Nov 1 '11 at 14:24
While you should include the essential information from a source in your answer, it seems that what you've done is to copy the entire article into your answer. You cited it, so this would be OK... except that it may violate the copyright held by the article's author. The copyright statement from the article does not give permission to do this and it's unlikely that copying such a large amount of text, constituting almost the entire work, would be considered "fair use." Do you have permission from the author to reproduce the work here? If not, I recommend totally rewording it (or delete). –  Eliah Kagan Aug 2 '12 at 17:43

I have published a startup script to setup an Amazon EC2 instance with IPSec/L2TP VPN. You can do it in less than 5 minutes, you dont even need to actually log into the machine.

The good thing with IPSec/L2TP: it works out of the box for most clients (tested with Mac OS Lion and Mountain Lion, not Linux yet).

You can get it here and get some background information about it on this site

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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