How to set a default VPN in Network Manager


I can not remember how to define a default VPN connection. My config looks like:

So whenever I connect ‘wired’ I also use the ‘Frankfurt dedicated IP’ connection. But I would like to change the default to ‘VPN Frankfurt (Surfshark)’. No chance: even if I manually change to
this setting does not survive a reboot. After having rebooted the Network Manager starts the ‘wired’ connection with ‘Frankfurt Dedicated IP’, not with ‘VPN Frankfurt (Surfshark)’.
So how can I change the preferred default VPN connection?

Thank you in advance.

Automatic connection activation depends on the VPN type.


Configure the VPN connection as usual:

  • Settings > Network > VPN > Connection > :gear: > Details > Connect automatically
nmcli connection show
nmcli connection modify VPN_CONNECTION \
    connection.autoconnect yes

VPNs like OpenVPN

Use nm-connection-editor or nmcli:

  • Ethernet / Wi-Fi > Connection > :gear: > General > Automatically connect to VPN
nmcli connection show
nmcli connection modify PARENT_CONNECTION 
    connection.secondaries VPN_CONNECTION

Thank you for the hint. But I now detected that this command can be used:
After that you have to select the connection you want to modify, press ENTER and select ‘General’. There you can set the VPN you want to connect to automatically:

That’s it.