8

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.

αғsнιη
  • 35,092
  • 41
  • 129
  • 192
kannzzmm2
  • 1,080
  • 1
  • 10
  • 25
  • 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 07 '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 07 '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 07 '19 at 14:20
  • 3
    Does this answer your question? [Automatically turn on VPN on computer unlock Ubuntu 18.04](https://askubuntu.com/questions/1033278/automatically-turn-on-vpn-on-computer-unlock-ubuntu-18-04) – αғsнιη Oct 21 '20 at 18:49

2 Answers2

15

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.

An0n
  • 2,049
  • 1
  • 11
  • 27
  • 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 07 '19 at 15:23
  • 1
    The comment is a new question and should be asked as such. Then it can be answered properly. – user68186 Jan 07 '19 at 15:40
  • As of 20.04 this explanaition works no more. I would like to know how this settings can be found under gnome shell?! – mondjunge Jan 11 '21 at 06:34
  • 1
    @mondjunge Open the Network Connections via Terminal, just type `nm-connection-editor` and press Enter. Worked for me in Ubuntu 20.04. – jamix Oct 05 '21 at 14:43
  • @jamix Thx. In the end my problem was ubuntu reseting preferences on the default LAN-Network after reboot. I had to create a new Network Connection to persist my preferences. – mondjunge Oct 06 '21 at 15:10
2

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.