How to Turn VPN on By Default?

I noticed the VPN that comes with Librem One does not activate automatically in PureOS. Is there a setting I’m missing somewhere that will make it so I don’t have to keep making sure the VPN is actually on and working every time I use my laptop?

1 Like

There is an issue with GNOME 3.30 where if you have any VPN set to auto connect, you will have to manually reconnect your wired or wireless network every time you boot your computer or resume from Suspend.

You set it by running nm-connection-editor in Tilix - select the network - click on the gear icon - General Tab - enable ‘Automatically connect to VPN’ - choose the VPN you’d like to auto connect to from the drop down and you’re done.

Now you might be wondering why I even wrote this out if it doesn’t work in GNOME 3.30. Yes its true that PureOS Stable probably won’t upgrade GNOME until the next major stable release. But once PureOS Rolling is released and is upgraded to GNOME 3.32 or 3.34 this will work. I’ve re-created the issue in Manjaro and another user did so in Fedora. Gnome 3.30 was the common denominator. Once both were upgraded to GNOME 3.32 the auto VPN connect feature worked.

3 Likes

Hi :blush::waving_hand: Please is there a way, in updated byzanthium, to automatically start on vpn when mobile data is turned on?
I can’t find any option in settings and AI gave me just a temporary solution, thank you :folded_hands:

ps: AI solution that works but it isn’t permanent:

purism@pureos:~$ nmcli connection modify “my mobile name company” connection.secondaries “abcd1234…-4c6b-43f2-b…”

1 Like

Untested by me, but should work:

  1. Install Advanced Network Manager and launch it.
  2. Find your carrier under “Mobile Broadband.”
  3. Tap it, then tap the settings gearwheel at bottom.
  4. On “General” tab, enable “Automatically conect to VPN.”
  5. Save.

For WiFi/Ethernet networks, if you don’t want to connect automatically to VPN, then make sure “Automatically connect to VPN” is not enabled there.

If your VPN is set up as a connection in Advanced Network Manager, you can set auto connection there, too, if you want.

I suppose a second option would be to create a script that connects the VPN when mobile is active, incorporating an “If” clause (i.e. If mobile is active), then connect to VPN (using the command you posted).

Third option, just have your VPN connect automatically regardless of type of network you’re on. :wink:

1 Like