Quantcast
Channel: LowEndTalk
Viewing all articles
Browse latest Browse all 59145

Auto install script for IPsec L2TP VPN

$
0
0

Just want to share with you guys an auto install script for IPsec L2TP VPN. The script was not written by me; however I found it very useful for automating VPN setup on a fresh Ubuntu 12.04 server:

https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh

Although the script was created for EC2, it can be easily adapted for other VPS running on a public IP. Just replace all $PRIVATE_IP with $PUBLIC_IP and it should work. The IPsec configuration already includes forceencaps=yes, which means the VPN encapsulates everything in UDP so it works even without GRE protocol support.

There's a typo in the script for getting the IP info from EC2. The correct lines are:

PRIVATE_IP=`wget -q -O - 'http://169.254.169.254/latest/meta-data/local-ipv4'` PUBLIC_IP=`wget -q -O - 'http://169.254.169.254/latest/meta-data/public-ipv4'`

Also, I wrote a bash script at my tech blog https://blog.ls20.com to automatically update IP addresses in VPN config files at boot time. This can be useful if the IP of your VPS ever changes, for example when taking snapshots and later re-deploy in iwStack, DigitalOcean, etc., and avoids the time-consuming task of editing config files manually.

Edit: Seems no one is interested in this.


Viewing all articles
Browse latest Browse all 59145

Trending Articles