iOS 10 Public beta version does not support PPTP anymore for security consideration. In a previous blog, I’ve shown how to setup PP2P VPN server on Ubuntu 14.04. Now, let’s setup L2TP/IPSec VPN.

## Step 1: Install requirements

First change to sudo mode, because we’ll have to use sudo many more times.

then,

## Step 2: Configure firewall

Here, please replace %YOUR-SERVER-IP% (remove % of course)
do the following to modify /etc/sysctl.conf:

Apply the above change with

## Step 3: Change /etc/rc.local

Before the line exit 0, add the following line (remember to replace %YOUR-SERVER-IP%), to make sure the modifications still work after reboot:

## Step 4: Configure Openswan (IPSEC)

add the following in conf setup part

add the following in the end of the file (remember to replace %YOUR-SERVER-IP%):

now, add the following line to /etc/ipsec.secrets (remember to replace %YOUR-SERVER-IP% and your-password):

now use

to check errors, it may show something like this:

The errors and warnings are okay. the Failed error is caused by an old perl version and can be ignored.

## Step 5: Configure xl2tp

add the following lines to the end:

now, create options.xl2tpd