Automatically turn on VPN on computer unlock Ubuntu 18.04

If you go into your WiFi connection settings for the AP you want to connect to the VPN on, there is an Always connect to VPN when using this connection: option, which you can enable, and select the VPN which you wish to automatically connect to.

Then when you connect to this connection (or when it reconnects on wake from suspend), the system will also attempt to connect to the VPN upon successfully reconnecting to the designated WiFi AP.

It seems the changes in newer GNOME have removed this option from the main UI, so you need to run nm-connection-editor to edit the connection, which should make the option available again.


It's not shown in the GUI, but you can still type

nm-connection-editor

in a terminal and select 'always connect to vpn...' under settings > general tab.


The "automatically connect to this VPN" checkbox has moved. Ubuntu 18.04. Run 'nm-connection-editor' and select the wifi network that you usually connect to. Click the gear, go to General tab. It's right there at the bottom - click the checkbox, then click the dropdown below and select the VPN you want to automatically connect to.

Tags:

Vpn

Openvpn

18.04