How to set up L2TP/IPSec VPN on Ubuntu

Ubuntu has stopped shipping L2TP over IPSec support since Precise. A workaround for this exists using network-manager-l2tp.

In this tutorial we will show you how to set up L2TP/IPSec VPN on Ubuntu but first let’s see what are our requirements and recommendations.

Requirements

In order to set up the L2TP/IPSec VPN you will need:

  1. A RayaVPN account. If you don’t have one you can try our services now.
  2. Your VPN username, password and VPN server address. You can find them in your account on our website, by going to your package.

If you want to set up L2TP/IPSec VPN manually, go step-by-step through following instructions:

 

L2TP/IPSec VPN Setup instructions

  1. Open Terminal (1).How to set up L2TP/IPSec VPN on Ubuntu: Step 1
  2. Type following commands one by one:sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
    sudo apt-get update
    sudo apt-get install network-manager-l2tp-gnome
  3. Click Network Manager (2) > “VPN Connections” (3) > “Configure VPN” (4).How to set up L2TP/IPSec VPN on Ubuntu: Step 2
  4. In the “Network Connections” window, select the “VPN” tab and press the “Add” button (5).In the “Choose a Connection Type” window select “Layer 2 Tunneling Protocol (L2TP)” (6) and press the “Create…” button (7).How to set up L2TP/IPSec VPN on Ubuntu: Step 3
  5. Select “Ipsec settings…” (8).How to set up L2TP/IPSec VPN on Ubuntu: Step 4
  6. Check the “Enable IPsec tunnel to L2TP host” checkbox (9).Enter the IP address of RayaVPN server you want to connect to in the “Gateway ID” field (10). You can find all the available servers in the package details in your account. Enter “123456” in the “Pre-shared” key field (11). Press “OK” (12).How to set up L2TP/IPSec VPN on Ubuntu: Step 5
  7. Set a name for your VPN connection in the “Connection name” field (13).Fill in the “User name” and “Password” fields (14) your VPN username and password. You can find them in your account on our website, by going to your package. Make sure you use your VPN username and password and NOT the website account credentials. Click on “Save” (15).How to set up L2TP/IPSec VPN on Ubuntu: Step 6
  8. The L2TP over IPsec VPN connection on Ubuntu is set up. Connect to VPN by choosing the created VPN connection from the “Network Manager”.