Wait! We Have a Special Deal!

Get CactusVPN for $3.5/mo!

Save 64% Now
30-Day Money-Back Guarantee
Setup Tutorials

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 CactusVPN account. If you don’t have one you can try our services for free.
  2. Your VPN username, password and VPN server address. You can find them in your account on our website, by going to Settings.

If you still 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 CactusVPN server you want to connect to in the Gateway ID field (10).

    You can find IP addresses of all our servers in your account on our website, by going to Settings.

    Type cactusvpn 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 your VPN username and password in your account on our website, by going to Settings -> VPN Username & Password. Make sure you use your VPN username and password and NOT the website account credentials (What is the difference?).

    Click on Save (15).

    How to set up L2TP/IPSec VPN on Ubuntu: Step 6

The L2TP over IPsec VPN connection on Ubuntu is set up. Connect to VPN by choosing the created VPN connection from the Network Manager.

VPN and Smart DNS Services

Protect online privacy, secure your connection and access blocked websites

Try CactusVPN For Free