I spent a long time getting this working myself so thought it best to save the steps somewhere. Be sure to follow every step exactly.
1) Run the following terminal commands.
sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp sudo apt-get update sudo apt-get install network-manager-l2tp sudo apt-get install network-manager-l2tp-gnome
2) Now Reboot your computer.
3) Open Network settings, click “+” to add a VPN connection of type “Layer 2 Tunneling Protocol (L2TP)”.
4) Enter a name for it.
5) Enter the hostname into the “Gateway” field.
6) Enter your username and password (click the <?> icon next to it first and select an option)
7) Click “IPSec Settings” and enter them as in the screenshot below.
8) Save/close the settings window(s).
9) Enter the following terminal commands:
sudo service xl2tpd stop sudo systemctl disable xl2tpd
10) Re-open the Network settings and attempt to connect to your newly created VPN, it should now work. If it doesn’t check out
tail -f /var/log/*.log for information on what could be wrong.