Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Auto install script for IPsec L2TP VPN

howardsl2howardsl2 Member
edited January 2014 in Tutorials

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 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. Please browse to my tech blog at https://blog.ls20.com

Comments

Sign In or Register to comment.