1
0
mirror of synced 2024-11-28 23:56:04 +03:00

Add support for Ubuntu 16.04 (Xenial)

This commit is contained in:
Lin Song 2016-04-06 02:51:37 -05:00 committed by hwdsl2
parent 4976bde854
commit d909b986cf
5 changed files with 23 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# IPsec/L2TP VPN Server Auto Setup Scripts # IPsec/L2TP VPN Server Auto Setup Scripts
Scripts for automatic configuration of IPsec/L2TP VPN server on Ubuntu 14.04 & 12.04, Debian 8 and CentOS/RHEL 6 & 7. All you need to do is providing your own values for `IPSEC_PSK`, `VPN_USER` and `VPN_PASSWORD`, and let them handle the rest. Scripts for automatic configuration of an IPsec/L2TP VPN server on Ubuntu 16.04/14.04/12.04, Debian 8 and CentOS 6 & 7. All you need to do is providing your own values for `IPSEC_PSK`, `VPN_USER` and `VPN_PASSWORD`, and let them handle the rest.
We will use <a href="https://libreswan.org/" target="_blank">Libreswan</a> as the IPsec server, and <a href="https://www.xelerance.com/services/software/xl2tpd/" target="_blank">xl2tpd</a> as the L2TP provider. We will use <a href="https://libreswan.org/" target="_blank">Libreswan</a> as the IPsec server, and <a href="https://www.xelerance.com/services/software/xl2tpd/" target="_blank">xl2tpd</a> as the L2TP provider.
@ -32,13 +32,13 @@ View my profile on LinkedIn at <a href="https://www.linkedin.com/in/linsongui" t
- Can be directly used as "user-data" for a new Amazon EC2 instance - Can be directly used as "user-data" for a new Amazon EC2 instance
- Automatically determines public IP and private IP of server - Automatically determines public IP and private IP of server
- Includes basic IPTables rules and `sysctl.conf` settings - Includes basic IPTables rules and `sysctl.conf` settings
- Tested with Ubuntu 14.04 & 12.04, Debian 8 and CentOS 6 & 7 - Tested with Ubuntu 16.04/14.04/12.04, Debian 8 and CentOS 6 & 7
## Requirements ## Requirements
A newly created <a href="https://aws.amazon.com/ec2/" target="_blank">Amazon EC2</a> instance, using these AMIs: (See <a href="https://blog.ls20.com/ipsec-l2tp-vpn-auto-setup-for-ubuntu-12-04-on-amazon-ec2/#vpnsetup" target="_blank">instructions</a>) A newly created <a href="https://aws.amazon.com/ec2/" target="_blank">Amazon EC2</a> instance, using these AMIs: (See <a href="https://blog.ls20.com/ipsec-l2tp-vpn-auto-setup-for-ubuntu-12-04-on-amazon-ec2/#vpnsetup" target="_blank">instructions</a>)
- <a href="http://cloud-images.ubuntu.com/trusty/current/" target="_blank">Ubuntu 14.04 (Trusty)</a> or <a href="http://cloud-images.ubuntu.com/precise/current/" target="_blank">12.04 (Precise)</a> - <a href="https://cloud-images.ubuntu.com/locator/" target="_blank">Ubuntu 16.04 (Xenial), 14.04 (Trusty) or 12.04 (Precise)</a>
- <a href="https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie" target="_blank">Debian 8 (Jessie) EC2 Images</a> - <a href="https://wiki.debian.org/Cloud/AmazonEC2Image" target="_blank">Debian 8 (Jessie) EC2 Images</a>
- <a href="https://aws.amazon.com/marketplace/pp/B00O7WM7QW" target="_blank">CentOS 7 (x86_64) with Updates HVM</a> - <a href="https://aws.amazon.com/marketplace/pp/B00O7WM7QW" target="_blank">CentOS 7 (x86_64) with Updates HVM</a>
- <a href="https://aws.amazon.com/marketplace/pp/B00NQAYLWO" target="_blank">CentOS 6 (x86_64) with Updates HVM</a> - <a href="https://aws.amazon.com/marketplace/pp/B00NQAYLWO" target="_blank">CentOS 6 (x86_64) with Updates HVM</a>
@ -46,7 +46,7 @@ A newly created <a href="https://aws.amazon.com/ec2/" target="_blank">Amazon EC2
A dedicated server or KVM/Xen-based Virtual Private Server (VPS), with the following OS: A dedicated server or KVM/Xen-based Virtual Private Server (VPS), with the following OS:
&nbsp;(Note: Starting with a freshly installed system is recommended) &nbsp;(Note: Starting with a freshly installed system is recommended)
- Ubuntu 14.04 (Trusty) or 12.04 (Precise) - Ubuntu 16.04 (Xenial), 14.04 (Trusty) or 12.04 (Precise)
- Debian 8 (Jessie) - Debian 8 (Jessie)
- Debian 7 (Wheezy) &raquo; Not recommended. Requires <a href="https://gist.github.com/hwdsl2/5a769b2c4436cdf02a90" target="_blank">this workaround</a> to work. - Debian 7 (Wheezy) &raquo; Not recommended. Requires <a href="https://gist.github.com/hwdsl2/5a769b2c4436cdf02a90" target="_blank">this workaround</a> to work.
- CentOS / Red Hat Enterprise Linux (RHEL) 6 or 7 - CentOS / Red Hat Enterprise Linux (RHEL) 6 or 7

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script for automatic configuration of IPsec/L2TP VPN server on Ubuntu 14.04/12.04 and Debian 8. # Script for automatic setup of an IPsec/L2TP VPN server on Ubuntu LTS and Debian 8.
# Works on dedicated servers and any KVM- or Xen-based Virtual Private Server (VPS). # Works on dedicated servers and any KVM- or Xen-based Virtual Private Server (VPS).
# It can also be used as Amazon EC2 "user-data" with the official Ubuntu or Debian AMIs. # It can also be used as Amazon EC2 "user-data" with the official Ubuntu or Debian AMIs.
# #
@ -124,6 +124,10 @@ wget -t 3 -T 30 -nv -O "$SWAN_FILE" "$SWAN_URL"
/bin/rm -rf "/opt/src/libreswan-$SWAN_VER" /bin/rm -rf "/opt/src/libreswan-$SWAN_VER"
tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE" tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; } cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
# Workaround for Libreswan compile issues
cat > Makefile.inc.local <<EOF
WERROR_CFLAGS =
EOF
make programs && make install make programs && make install
# Check if Libreswan install was successful # Check if Libreswan install was successful

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script for automatic configuration of IPsec/L2TP VPN server on 64-bit CentOS/RHEL 6 & 7. # Script for automatic setup of an IPsec/L2TP VPN server on 64-bit CentOS/RHEL 6 & 7.
# Works on dedicated servers and any KVM- or Xen-based Virtual Private Server (VPS). # Works on dedicated servers and any KVM- or Xen-based Virtual Private Server (VPS).
# It can also be used as Amazon EC2 "user-data" with the official CentOS 6 & 7 AMIs. # It can also be used as Amazon EC2 "user-data" with the official CentOS 6 & 7 AMIs.
# #
@ -164,6 +164,10 @@ wget -t 3 -T 30 -nv -O "$SWAN_FILE" "$SWAN_URL"
/bin/rm -rf "/opt/src/libreswan-$SWAN_VER" /bin/rm -rf "/opt/src/libreswan-$SWAN_VER"
tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE" tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; } cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
# Workaround for Libreswan compile issues
cat > Makefile.inc.local <<EOF
WERROR_CFLAGS =
EOF
make programs && make install make programs && make install
# Check if Libreswan install was successful # Check if Libreswan install was successful

View File

@ -106,6 +106,10 @@ wget -t 3 -T 30 -nv -O "$SWAN_FILE" "$SWAN_URL"
/bin/rm -rf "/opt/src/libreswan-$SWAN_VER" /bin/rm -rf "/opt/src/libreswan-$SWAN_VER"
tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE" tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; } cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
# Workaround for Libreswan compile issues
cat > Makefile.inc.local <<EOF
WERROR_CFLAGS =
EOF
make programs && make install make programs && make install
# Restart IPsec service # Restart IPsec service

View File

@ -131,6 +131,10 @@ wget -t 3 -T 30 -nv -O "$SWAN_FILE" "$SWAN_URL"
/bin/rm -rf "/opt/src/libreswan-$SWAN_VER" /bin/rm -rf "/opt/src/libreswan-$SWAN_VER"
tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE" tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; } cd "libreswan-$SWAN_VER" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
# Workaround for Libreswan compile issues
cat > Makefile.inc.local <<EOF
WERROR_CFLAGS =
EOF
make programs && make install make programs && make install
# Restore SELinux contexts # Restore SELinux contexts