Network Manager VPN does not remember its status

Hi all,

I have successfully created a wireguard configuration file using Proton VPN, imported that into network manager and now I can select the connection from network manager. Very nice.

What is not so nice is that I only need the VPN every now and then, and for normal day to day tasks it is actually a nuisance (many services I use won’t work when using the VPN), so I usually turn it off. However, after every log out/in or reboot it turns itself back on.

Is there a way to make it remember its last state, or just default to “off” (although remembering its last state is preferred).

I’m on NixOS 24.05 (Uakari), Linux 6.6.52, Wayland.

If I go to “about”, as detailed here, there is no Gnome version, but I’m pretty sure it’s the very latest.

1 Like

Yes. You have a connection profile in NetworkManager. Change its connection.autoconnect setting to “no”.

You can use one of the UIs for that (nm-connection-editor, KDE’s plasma-nm, GNOME’s control-center). See “connect with priority” checkbox (or whatever it is called).

Or, nmcli connection modify "$PROFILENAME" connection.autoconnect no (where you get the $PROFILENAME from nmcli connection output).

1 Like

Ah, thanx, in Gnome’s control center there appears to be no such setting, but installing nm-connection-editor (in NixOS you can use it temporarily using nix-shell -p networkmanagerapplet) I indeed have the setting “Connect automatically with priority”, which I have disabled now. Let me reboot and test.

Update-after-reboot: Yes, this works! Thank you!