How to setup PureVPN IPSEC/L2TP or any other VPN provider’s on Ubuntu GUI
By: Arash Arbabi
Tags: Ubuntu, Ipsec, L2tp, VPN

The official pureVPN Guides teach you how to setup an SSTP VPN on Ubuntu (Which is outdated) but SSTP is a bit slow compared to other VPN protocols so I wanted to setup the VPN over L2TP/IPSEC.

It seems that the PureVPN linux client does not tunnel the whole device at the moment.

This was a huge headache, nothing seemed to work and We spent about 10 Hours to make this work, in this article I’m gonna show you what worked in the end so you don’t go through the same headaches that we went through.

Step 1:

First things first, You need to install the required software:

sudo apt-get install network-manager network-manager-l2tp network-manager-l2tp-gnome xl2tpd

Step 2:

Open Ubuntu settings and go to the network section and press the + button.

Step 3:

Select L2TP (If you don’t see this option it means that you have not installed all the packages needed)

Step 4:

Select a name for your connection, Enter your gateway address (aka, server address), Enter the username and password (You may need to first click on the “?” Icon and choose a password saving mode) of your PureVPN account.

Step 5:

Click on IPSEC settings

Pre-shared key: 12345678 (This is provided by PureVPN)

open the advanced pane

Phase1 Algorithms: 3des-sha1-modp1024

Phase2 Algorithms: 3des-sha1

Leave Gateway ID empty.

Leave enforce UDP encapsulation unchecked.

Click OK

Step 6:

Click on PPP Settings

Configure it as follows:

Press OK.

Press the Green Apply on the top right.

Now you can connect to your VPN! Enjoy!

What if I’m not using PureVPN?

If you are not using PureVPN you can find out your own VPN providers server settings using a tool called ike-scan the steps for doing so are as follows:

sudo apt-get install ike-scan

After that you need to disconnect from any VPN and run the following commands:

sudo ipsec stop

sudo service xl2tpd stop

After that we will run ike-scan:

sudo ike-scan YOUR.SERVER.IP

for PureVPN US this would be:

sudo ike-scan usoh1.pointtoserver.com

The output should be:



172.94.5.1 Main Mode Handshake returned HDR=(CKY-R=21dad0ddb501e149) SA=(Enc=3DES Hash=SHA1 Group=2:modp1024 Auth=PSK LifeType=Seconds LifeDuration(4)=0x00007080) VID=1e2b516905991c7d7c96fcbfb587e46100000009 (Windows-8) VID=4a131c81070358455c5728f20e95452f (RFC 3947 NAT-T) VID=90cb80913ebb696e086381b5ec427b1f (draft-ietf-ipsec-nat-t-ike-02

) VID=4048b7d56ebce88525e7de7f00d6c2d3 (IKE Fragmentation) VID=fb1de3cdf341b7ea16b7e5be0855f120 (MS-Negotiation Discovery Capable) VID=e3a5966a76379fe707228231e5ce8652 (IKE CGA version 1) Starting ike-scan 1.9.4 with 1 hosts ( http://www.nta-monitor.com/tools/ike-scan/ 172.94.5.1 Main Mode Handshake returned HDR=(CKY-R=21dad0ddb501e149) SA=(Enc=3DES Hash=SHA1 Group=2:modp1024 Auth=PSK LifeType=Seconds LifeDuration(4)=0x00007080) VID=1e2b516905991c7d7c96fcbfb587e46100000009 (Windows-8) VID=4a131c81070358455c5728f20e95452f (RFC 3947 NAT-T) VID=90cb80913ebb696e086381b5ec427b1f (draft-ietf-ipsec-nat-t-ike-02

) VID=4048b7d56ebce88525e7de7f00d6c2d3 (IKE Fragmentation) VID=fb1de3cdf341b7ea16b7e5be0855f120 (MS-Negotiation Discovery Capable) VID=e3a5966a76379fe707228231e5ce8652 (IKE CGA version 1) Ending ike-scan 1.9.4: 1 hosts scanned in 0.581 seconds (1.72 hosts/sec). 1 returned handshake; 0 returned notify

As you can see on the third line we have:

SA=(Enc=3DES Hash=SHA1 Group=2:modp1024 Auth=PSK LifeType=Seconds

This tells us what to use for the Phase1 Algorithm and Phase2 Alogrithm that we did on the advanced pane.

Phase1 Algorithms: 3des-sha1-modp1024

Phase2 Algorithms: 3des-sha1

for Phase1 we have Enc-Hash-Group

for Phase2 we have Enc-Hash

Remember that most L2TP VPN providers use these values so you should first try these.

Credits: https://github.com/HosseinAgha