Ubuntu – Ubuntu 18.04 VPN L2TP with PSK

vpn

I tried to configure a vpn-connection having an username, a password and a pre-shared-key (psk) from my admin at office.

Over many hours I tried several possibilities and methods (openvpn, openswan, networkmanager-l2tp-gnome, xl2tpd), but I can't establish a connection to my office.

But the given parameters are still working, because I tried using Win7 and on my Android-Phone.

Why is it so heavy to configure such a simple thing like a vpn, where I've only to put in 3 parameters? On my phone, I put the parms in and it works fine.

Please help me to find out the right way to configure the vpn.
Because I want use Linux!!!

Many thanks,
GueBr

Best Answer

I had the same problem and changing the VPN server wasn't an option, out of my control.

I chased my tail with lots of solutions, edited and reverted many config files, and tried setting the phase 1 and phase 2 algorithms in the Network Manager VPN setup, IPSec config. None of it worked until I used ppa:nm-l2tp/network-manager-l2tpapt to install a sane version:

sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
sudo apt update
sudo apt install network-manager-l2tp network-manager-l2tp-gnome
sudo apt upgrade

After installing that, updating network-manager-l2tp and rebooting, the VPN connection "just worked". My config still had the overrides for phase 1 and phase 2, so maybe that helped too. I also had disabled autostarting of xl2tpd, so in case those changes help, here they are:

VPN SettingsConfigureIdentityIPSec Settings:

  • Phase 1: aes128-sha1-modp2048!
  • Phase 2: 3des-sha1

Those were selected based on posts about it being the most likely combination and verified by running ike-scan:

sudo ike-scan <vpn hostname or ip>

Disabling xl2tpd:

sudo systemctl disable xl2tpd