You are not logged in.

#1 2022-07-02 21:30:17

lfitzgerald
Member
Registered: 2021-07-16
Posts: 174

[SOLVED] NetworkManager auto-connecting to WireGuard

I use NetworkManager with two WireGuard connection imported for my VPN. The two connections correspond to two different servers. I use one server or the other depending on the situation.

Both came as fairly simple WireGuard configs which I added with

nmcli connection import type wireguard file foo.conf

The problem is that at boot, NM tries to connect to *both*. This of course makes my internet not work, until I manually disable one with

nmcli connection down foo

Surely there's a setting somewhere in NM that says "don't automatically connect to this" - where is it? Or do I have to write my own systemd timer?

Last edited by lfitzgerald (2022-07-03 01:43:31)

Offline

#2 2022-07-02 21:50:19

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [SOLVED] NetworkManager auto-connecting to WireGuard

Yes, the setting is called "autoconnect", the cli option would be

nmcli connection modify "$wgprofile" autoconnect no

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2022-07-03 01:42:59

lfitzgerald
Member
Registered: 2021-07-16
Posts: 174

Re: [SOLVED] NetworkManager auto-connecting to WireGuard

Thank you! Also I was able to check the value of this with

nmcli connection show "$wgprofile"

Offline

Board footer

Powered by FluxBB