Everytime I use Vpn I need to connect to the VPN manually using different countries.

Is there a way to connect to the VPN automatically after the system starts on Ubuntu 18.04? Thanks.

  • Yes, it's part of the Gnome VPN Client, part of the stock Ubuntu install. Put your VPN server settings into the client and turn on the 'automatic' switch. – user535733 Jan 7 '19 at 14:07
  • It can be done for a specific WiFi network. If you go to a new country, or a new coffee shop you may have to set it up first time. It may also depend on your VPN service provider. Different provider may have their own app that may allow what you want. – user68186 Jan 7 '19 at 14:11
  • Can you please give me more information how can i do this ? I have set the config files from VPN provider using Settings, Network, Add Vpn but here is no option for automatically connecting to VPN. Thanks for your help. – kannzzmm2 Jan 7 '19 at 14:20

To automatically connect to VPN

  • Launch nm-connection-editor or open Network Connections.
  • Choose you WiFi or LAN connection, click "Edit", select the "General" tab.
  • Enable "Automatically connect to VPN when using this connection".

Extra info on installing open VPN and use the same "settings, country" every time check this link.

| improve this answer | |
  • Thanks for your help. I had enabled Automatically connect to VPN when using this connection using the nm-connection-editor, but now the problem is after i turn on the system from suspend mode i get the notification connection failed and it wont be connected to the internet automatically using wired connection or wifi.. – kannzzmm2 Jan 7 '19 at 15:23
  • The comment is a new question and should be asked as such. Then it can be answered properly. – user68186 Jan 7 '19 at 15:40

In addition to AnOn's answer you might want to have a look at this answer. If you "Store the password for all users" then the VPN will also automatically connect after waking up from being suspended.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.