Ubuntu 18.04 has a nice GNOME GUI for VPN, but it still takes a little effort to get it fully working. Here is what I did:
I connect to a VPN that is based on Cisco AnyConnect, which means that I must use OpenConnect and that is not installed by default. Fortunately, Ubuntu has some useful documentation (https://help.ubuntu.com/community/NetworkManager) that points out which packages to install. I used the following commands to install OpenConnect for Network Manager:
sudo apt-get install network-manager-openconnect
sudo apt-get install network-manager-openconnect-gnome
Once that is done, then I can setup my VPN connection.
- Open “Settings” -> “Network”
- In the VPN-section, click the “+”
- Select “Cisco AnyConnect Compatible VPN (openconnect)”
- Give the VPN a sensible name, write the URL to the VPN in the “Gateway” field and leave the rest as default. This is sufficient in my case.
- Now you can turn the VPN “on” by clicking “off” in “Settings” -> “Network”.
However, when the VPN is turned on, it fails to use the DNS from the VPN which means that I cannot access the internal websites behind the VPN unless I know the IP-adresses. I have tried many different solutions that didn’t work until I found something useful (https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1688018). Do the following:
- sudo gedit /etc/NetworkManager/system-connections/<NAME_OF_YOUR_VPN_CONNECTION>
- Add the following to the “[ipv4]” section: dns-priority=-1
- Restart the network manager: sudo systemctl restart NetworkManager.service
I hope that this guide saved you from having to read page after page of solutions that does not work – I wasted enough time on that 🙂