How to prevent VPN being enabled automatically on resume?

I don’t need to use my (Wireguard) VPN connection(s) that often, but everytime I resume my laptop running Workstation 40 it enables one of my VPN connections.

I can’t see any settings for this anywhere, and I don’t understand what’s making it do it.

Any ideas?

Are you resuming from suspend or hibernation?
It would seem that the vpn connection may have been active when the last kernel upgrade was performed and that network connection would then be stored in the initramfs image that is used to resume.

I think that using sudo dracut --force when the vpn is not active should solve the issue. man dracut should guide you if you want to build a new image for kernels other than the currently booted kernel.

2 Likes

Added f40, wireguard

Thanks for your suggestion. However, I turned off the VPN, ran the dracut --force command, rebooted and … VPN is still enabled by default!

I believe it’s enabled on resume-from-suspend, resume-from-hibernate (but not 100% sure, it’s been a while), reboot.

WireGuard operates as a persistent connection, preventing traffic leaks.
Once activated, it cannot be disrupted by suspend/resume events.

2 Likes

Guess, try:

$ nmcli connection modify YourWireguardConnection autoconnect no

Maybe that will work? (Of course replace YourWireguardConnection with the name of your connection. Use tab completion to list available names.)

1 Like

@catanzaro brilliant, thanks, that did it!

1 Like