Ubuntu – 20.04LTS NetworkManager VPN – Always on


I have a working VPN connection setup in Ubuntu 20.04LTS.
How do I setup such that it auto connects when the wifi is connected to a specific SSID?

For example, i always frequent "This_wifi_network".
I would like the VPN to auto turn on when wifi is connect to this public network.


Best Answer

Open the hidden Network Connection Editor

There is a hidden app that does not show when you search for it. To open this app, open a terminal by pressing Ctrl+Alt+T and enter:


This will open the Network Connection Editor as below:

enter image description here

  1. Select your WiFi Network
  2. Click on the Settings "cog" icon below

See the picture below for the next screen:

enter image description here

  1. Select the General tab
  2. Check the box next to Automatically connect to VPN when using this connecion
  3. Select the VPN from the drop-down menu below.
  4. Click the Save button below to save the changes.

Unhide Network Connection Editor

To make Network Connection Editor show up in applications searches in Gnome, do the following:

Go to /usr/share/applications and find the icon for “Network Connections”. Right click and edit as administrator. Comment out the line: NotShowIn=KDE;GNOME; to:


Now it will show up in the “Show Application”

Hope this helps