It wasn’t an easy task for me, so posting a solution here:
The Easy Part
Install latest network-manager l2tp package:
sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp sudo apt update sudo apt install network-manager-l2tp network-manager-l2tp-gnome
Go to Settings -> Network -> VPN -> Click a + sign -> L2TP:
Type your gateway ip, username and password:
Click on IPsec Settings and type your pre-shared key, don’t fill anything in Advanced, just click Apply, and Apply again.
As far as documentation I saw, that would be enough for connecting to the VPN. But nope, my VPN was constantly timeouting.
The Hard Part
Figuring out what went wrong, that was a pain.
I scanned the logs in syslog and
journalctl -f , found an error like “EAP: unknown authentication type”.
If you get a similar error, solution would be to go to your VPN settings, then PPP settings, disable all authentication methods except one, like MSCHAP.
Click Apply, try connecting to the VPN, and hopefully you’ll finally connect like I did.