My ISP uses L2TP to connect users to the Internet. I have a working connection on Windows and now I'm trying to clone it to an Ubuntu VM. Of course, I'm getting the intermittent "service failed to start" and "service stopped unexpectedly" errors like any other guy.
The first hoop to jump through seems to be L2TP host name resolution. On Windows I have it written in domain name form; I guess it gets resolved via DHCP. On Ubuntu name resolution fails:
Started the VPN service, PID 7461
Saw the service appear; activating connection
VPN connection: (ConnectInteractive) reply received
VPN connection: failed to connect: 'couldn't look up L2TP VPN gateway IP address '
VPN plugin: state changed: stopped (6)
VPN service disappeared
If I resolve the name manually in Windows (with L2TP down!) and copy the IP address over to Ubuntu, this phase passes and connection fails further down the road. Pinging the L2TP host name with L2TP down works on Windows but fails on Ubuntu.
Hence I assume that Ubuntu fails to use my ISP's DHCP server. Any ideas what to do about it?
To avoid Ubuntu 18.04 bug LP#1778946 which breaks DNS resolution after disconnecting the VPN connection, install the resolvconf package :
Alternatively install a newer version of network-manager-l2tp package from: