Scripts for automatic setup of an IPsec/L2TP VPN server on Ubuntu 14.04 & 12.04, Debian 8 and CentOS/RHEL 6 & 7. Works on dedicated servers or any KVM- or XEN-based Virtual Private Server (VPS), with **freshly installed** Linux OS.
They can also be used as Amazon EC2 "user-data" with the <ahref="https://cloud-images.ubuntu.com/locator/ec2/"target="_blank">Ubuntu 14.04/12.04</a>, <ahref="https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie"target="_blank">Debian 8</a> or <ahref="https://aws.amazon.com/marketplace/pp/B00O7WM7QW"target="_blank">CentOS 7</a> AMIs.
Do **NOT** run these scripts on your PC or Mac! They are meant to be run on a dedicated server or VPS.
For Windows users, a <ahref="https://documentation.meraki.com/MX-Z/Client_VPN/Troubleshooting_Client_VPN#Windows_Error_809"target="_blank">one-time registry change</a> is required for connections to a VPN server behind NAT (e.g. Amazon EC2).
If using Amazon EC2, these ports must be open in the security group of your VPN server: UDP ports 500 & 4500, and TCP port 22 (optional, for SSH).
If your server uses a custom SSH port (not 22), or if you wish to allow other services through IPTables, be sure to edit the IPTables rules in the scripts before using.
The scripts will backup /etc/rc.local, /etc/sysctl.conf, /etc/iptables.rules and /etc/sysconfig/iptables before overwriting them. Backups can be found under the same folder with .old suffix.
Copyright (C) 2014 Lin Song <ahref="https://www.linkedin.com/in/linsongui"target="_blank"><imgsrc="https://static.licdn.com/scds/common/u/img/webpromo/btn_profile_bluetxt_80x15.png"width="80"height="15"border="0"alt="View my profile on LinkedIn"></a>
Based on the work of Thomas Sarlandie (Copyright 2012)
This work is licensed under the <ahref="http://creativecommons.org/licenses/by-sa/3.0/"target="_blank">Creative Commons Attribution-ShareAlike 3.0</a>
Attribution required: please include my name in any derivative and let me know how you have improved it!