Set up L2TP VPN on Ubuntu

  1. Run the Terminal application.
  2. Add the L2TP/IPSec application repository. Run:
    $ sudo apt-add-repository ppa:werner-jaeger/ppa-werner-vpn
  3. Update the repositories and install the l2tp-ipsec-vpn application: 
    $ sudo apt-get update 
    $ sudo apt-get install l2tp-ipsec-vpn
  4. Select "No" if the program asks to install the certificate
  5. Click on "Dash home", run the "L2TP Ipsec VPN Applet".
    This will create an icon on your top panel with two computers. Click on that icon and choose "Edit Connections...".
  6. Provide your Ubuntu user password and click "OK".
  7. The "VPN Connections" window will appear. Click the "Add..." button.
  8. Enter the desired "Connection name" (SeSvenskTV) and click "OK". (Please make sure you enter the Connection name exactly like this, with the same capitalization, or a later step in this instruction will fail!)
  9. The connection is now created.
    Select it and click "Edit...".
  10. Select the "IPsec" tab. Enter the "Remote Server" address and the "pre-shared key for authentication". 
    Remote Server is your Server Address, and pre-shared key. 
    (See your welcome message for Server Address and Pre-Shared key)
  11. Now choose the "PPP" tab. 
    Select "Allow these protocols", enter your "User name" and "Password". 
    (See your welcome message for User Name and Password)
  12. Click the "IP Settings" button, and check the checkbox "Obtain DNS Server addresses automatically" and cClick "OK".
  13. Click "OK" again
  14. Click "Close".
  15. Go back to, or re-start, the Terminal application.
  16. Edit the config file for the connection, run:
    $ sudo nano /etc/ppp/SeSvenskTV.options.xl2tpd
    (Note! The first part of the file name after /etc/ppp/ is the Connection name you entered in step 8 above. If you entered something else than "SeSvenskTV" you must replace that part of the file name with the data you actually entered!)
    Give your Ubuntu password when asked.
  17. In the file, find the line:
    plugin passprompt.so
    and comment it out by adding a hash character in front, making it:
    #plugin passprompt.so
  18. Do the same, add hash character in the beginning of the lines beginning with:
    promptprog
    remotename
  19. Find the line:
    name "yourusername"
    (where "yourusername" is your actual username for our system)
  20. After this line, add the line:
    password yourpassword
    (where yourpassword is the actual password for our system)
  21. Press Ctrl-X and choose to save the file.
  22. Now click on the L2TP applet icon in your top panel once more and click on your connection in a dropdown list (SeSvenskTV in this case).
  23. The information window will show up and notify you when the VPN is connected. Please also notice the absence of red cross on L2TP applet icon.
  24. Done. You are connected.

 

Connecting L2TP VPN on Ubuntu

Click on the L2TP Ipsec VPN Applet icon on your desktop bar Notification Area. Select "SeSvenskTV".
Once VPN is connected, you'll see a message and red cross on the L2TP icon should disappear.

 

Disconnecting L2TP VPN on Ubuntu

Click on the L2TP Ipsec VPN Applet icon on your desktop bar Notification Area. Select "Disconnect".
Once VPN is disconnected, you'll see a message and red cross on the L2TP icon should appear.