Network manager does not auto-connect at boot-time to a Wi-Fi and a WireGuard VPN at the same time
How can I set up network manager to auto-connect at boot-time to a Wi-Fi and a WireGuard VPN?
I configured Network Manager with two connections: a Wi-Fi and a WireGuard VPN. They both work when I start them up manually. I've set-up both connections to auto-start upon boot. After booting, both connections show as active and connected, but I cannot access the network/internet. If I restart manually the WireGuard VPN, everything works and I am able to access the network again.
This is very annoying! Any ideas what could be wrong and how can I set this up correctly?
FYI I am running Kubuntu 22.10.
These are my Network Manager config files for these two questions:
**SS-NL-WG**
[connection]
id=SS-NL-WG
uuid=9xxxxxxxxxx7
type=wireguard
autoconnect-
interface-
[wireguard]
private-
[wireguard-
endpoint=
allowed-
[ipv4]
address1=
dns=xxxxxxxxxx;
method=manual
[ipv6]
addr-gen-
method=disabled
##H369A3D4517## (wi-fi)
[connection]
id=H369A3D4517
uuid=fxxxxxxxxx
type=wifi
autoconnect-
[wifi]
mode=infrastructure
ssid=H369A3D4517
[wifi-security]
key-mgmt=wpa-psk
psk=xxxxxxxxxxxx
[ipv4]
method=auto
[ipv6]
addr-gen-
method=auto
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Related FAQ:
None Link to a FAQ
Revision history for this message
|
#1 |
What steps do you take to start them up manually, please?
Revision history for this message
|
#2 |
Hallo! I am not sure if I understand your question well..
If I want start the connections manually, I just click "connect" on the two connections via the network-
Revision history for this message
|
#3 |
https:/
Here is the debug info from wireguard.
Revision history for this message
|
#4 |
I didn't install the wireguard package. I set up a wireguard vpn via network manager (which offers wireguard vpn by default, no plugin necessary).
Revision history for this message
|
#5 |
after looking at the logs, i think i understand what the problem is. I noticed how at boot-time NetwrokManager first successfully activates (!!?!?) the Wireguard VPN connection and only after it activates the WiFi connection. Which is of course a bug: how can you activate a VPN connection if there is no network connection present?
FYI, my log (only for NetworkManager):
Date Process Message
22/11/2022 20:03 NetworkManager <info> [1669143808.3618] NetworkManager (version 1.40.0) is starting... (boot:f9524a9e-
22/11/2022 20:03 NetworkManager <info> [1669143808.3619] Read config: /etc/NetworkMan
22/11/2022 20:03 NetworkManager <info> [1669143808.3650] bus-manager: acquired D-Bus service "org.freedeskto
22/11/2022 20:03 NetworkManager <info> [1669143808.3726] manager[
22/11/2022 20:03 NetworkManager <info> [1669143808.3731] monitoring ifupdown state file '/run/network/
22/11/2022 20:03 NetworkManager <info> [1669143808.3771] hostname: hostname: using hostnamed
22/11/2022 20:03 NetworkManager <info> [1669143808.3771] hostname: static hostname changed from (none) to "HP-ENVY"
22/11/2022 20:03 NetworkManager <info> [1669143808.3786] dns-mgr: init: dns=systemd-
22/11/2022 20:03 NetworkManager <info> [1669143808.3817] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/
22/11/2022 20:03 NetworkManager <info> [1669143808.3822] manager[
22/11/2022 20:03 NetworkManager <info> [1669143808.3823] manager[
22/11/2022 20:03 NetworkManager <info> [1669143808.3872] Loaded device plugin: NMWifiFactory (/usr/lib/
22/11/2022 20:03 NetworkManager <info> [1669143808.3900] Loaded device plugin: NMAtmManager (/usr/lib/
22/11/2022 20:03 NetworkManager <info> [1669143808.3942] Loaded device plugin: NMWwanFactory (/usr/lib/
22/11/2022 20:03 NetworkManager <info> [1669143808.3990] Loaded device plugin: NMTeamFactory (/usr/lib/
22/11/2022 20:03 NetworkManager <info> [1669143808.4019] Loaded device plugin: NMBluezManager (/usr/lib/
22/11/2022 20:03 NetworkManager <info> [1669143808.4024] manager: rfkill: Wi-Fi enabled by radio killswitch; enabled by state file
22/11/2022 20:03 NetworkManager <info> [1669143808.4034] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
22/11/2022 20:03 NetworkManager <info> [1669143808.4034] manager: Networking is enabled by state file
22/11/2022 20:03 NetworkManager <info> [1669143808.4056] settings: Loaded settings plugin: ifupdown ("/usr/
22/11/2022 20:03 NetworkManager <info> [1669143808.4056] settings: Loaded settings plugin: keyfile (internal)
22/11/2022 20:03 NetworkManager <info> [1669143808.4057] ifupdown: management mode: unmanaged
22/11/2022 20:03 NetworkManager <info> [1669143808.4059] ifupdown: interfaces file /etc/network/
22/11/2022 20:03 NetworkManager <info> [1669143808.4156] dhcp: init: Using DHCP client 'internal'
22/11/2022 20:03 NetworkManager <info> [1669143808.4161] device (lo): carrier: link connected
22/11/2022 20:03 NetworkManager <info> [1669143808.4166] manager: (lo): new Generic device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143808.4181] device (wlo1): driver supports Access Point (AP) mode
22/11/2022 20:03 NetworkManager <info> [1669143808.4198] manager: (wlo1): new 802.11 Wi-Fi device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143808.4216] device (wlo1): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
22/11/2022 20:03 NetworkManager <info> [1669143808.9514] manager: (SS-NL-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143808.9922] device (SS-NL-WG): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
22/11/2022 20:03 NetworkManager <info> [1669143808.9986] manager: (SS-BE.ANR-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143808.9990] manager: (SS-DE.BER-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143808.9996] manager: (SS-GR-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143809.0001] manager: (SS-US.NYC-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143809.0005] manager: (SS-UK.LON-WG): new WireGuard device (/org/freedeskt
22/11/2022 20:03 NetworkManager <info> [1669143809.0007] failed to open /run/network/
22/11/2022 20:03 NetworkManager <info> [1669143809.0053] device (SS-NL-WG): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0098] modem-manager: ModemManager available
22/11/2022 20:03 NetworkManager <info> [1669143809.0126] policy: auto-activating connection 'SS-NL-WG' (9098dbf0-
22/11/2022 20:03 NetworkManager <info> [1669143809.0133] device (SS-NL-WG): Activation: starting connection 'SS-NL-WG' (9098dbf0-
22/11/2022 20:03 NetworkManager <info> [1669143809.0134] device (SS-NL-WG): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0138] manager: NetworkManager state is now CONNECTING
22/11/2022 20:03 NetworkManager <info> [1669143809.0141] device (SS-NL-WG): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0149] device (SS-NL-WG): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0160] device (SS-NL-WG): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0164] device (SS-NL-WG): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0260] device (SS-NL-WG): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0331] device (SS-NL-WG): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0353] device (SS-NL-WG): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0355] device (SS-NL-WG): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143809.0359] manager: NetworkManager state is now CONNECTED_LOCAL
22/11/2022 20:03 NetworkManager <info> [1669143809.0362] device (SS-NL-WG): Activation: successful, device activated.
22/11/2022 20:03 NetworkManager <info> [1669143809.0664] device (wlo1): supplicant interface state: internal-starting -> disconnected
22/11/2022 20:03 NetworkManager <info> [1669143809.0665] device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-
22/11/2022 20:03 NetworkManager <info> [1669143813.5811] policy: auto-activating connection 'H369A3D4517' (f6cda0f3-
22/11/2022 20:03 NetworkManager <info> [1669143813.5818] device (wlo1): Activation: starting connection 'H369A3D4517' (f6cda0f3-
22/11/2022 20:03 NetworkManager <info> [1669143813.5820] device (wlo1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143813.5823] manager: NetworkManager state is now CONNECTING
22/11/2022 20:03 NetworkManager <info> [1669143813.5827] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143813.5832] device (wlo1): Activation: (wifi) access point 'H369A3D4517' has security, but secrets are required.
22/11/2022 20:03 NetworkManager <info> [1669143813.5832] device (wlo1): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143813.5835] sup-iface[
22/11/2022 20:03 NetworkManager <info> [1669143813.5850] device (wlo1): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143813.5855] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143813.5859] device (wlo1): Activation: (wifi) connection 'H369A3D4517' has security, and secrets exist. No new secrets needed.
22/11/2022 20:03 NetworkManager <info> [1669143813.5860] Config: added 'ssid' value 'H369A3D4517'
22/11/2022 20:03 NetworkManager <info> [1669143813.5860] Config: added 'scan_ssid' value '1'
22/11/2022 20:03 NetworkManager <info> [1669143813.5860] Config: added 'bgscan' value 'simple:
22/11/2022 20:03 NetworkManager <info> [1669143813.5861] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
22/11/2022 20:03 NetworkManager <info> [1669143813.5861] Config: added 'psk' value '<hidden>'
22/11/2022 20:03 NetworkManager <info> [1669143814.0885] device (wlo1): supplicant interface state: disconnected -> scanning
22/11/2022 20:03 NetworkManager <info> [1669143814.6686] device (wlo1): supplicant interface state: scanning -> authenticating
22/11/2022 20:03 NetworkManager <info> [1669143814.6708] device (wlo1): supplicant interface state: authenticating -> associating
22/11/2022 20:03 NetworkManager <info> [1669143814.6790] device (wlo1): supplicant interface state: associating -> associated
22/11/2022 20:03 NetworkManager <info> [1669143814.6868] device (wlo1): supplicant interface state: associated -> 4way_handshake
22/11/2022 20:03 NetworkManager <info> [1669143814.7687] device (wlo1): supplicant interface state: 4way_handshake -> completed
22/11/2022 20:03 NetworkManager <info> [1669143814.7688] device (wlo1): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "H369A3D4517"
22/11/2022 20:03 NetworkManager <info> [1669143814.7690] device (wlo1): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143814.7696] dhcp4 (wlo1): activation: beginning transaction (timeout in 45 seconds)
22/11/2022 20:03 NetworkManager <info> [1669143814.7812] dhcp4 (wlo1): state changed new lease, address=192.168.2.5
22/11/2022 20:03 NetworkManager <info> [1669143814.7817] policy: set 'H369A3D4517' (wlo1) as default for IPv4 routing and DNS
22/11/2022 20:03 NetworkManager <info> [1669143814.7883] device (wlo1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143814.7910] device (wlo1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143814.7913] device (wlo1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
22/11/2022 20:03 NetworkManager <info> [1669143814.7918] manager: NetworkManager state is now CONNECTED_SITE
22/11/2022 20:03 NetworkManager <info> [1669143814.7924] device (wlo1): Activation: successful, device activated.
22/11/2022 20:03 NetworkManager <info> [1669143814.7929] manager: NetworkManager state is now CONNECTED_GLOBAL
22/11/2022 20:03 NetworkManager <info> [1669143814.7933] manager: startup complete
22/11/2022 20:03 NetworkManager <info> [1669143829.7523] agent-manager: agent[d0dac3789
22/11/2022 20:03 NetworkManager <info> [1669143832.2168] audit: op="statistics" interface="wlo1" ifindex=2 args="500" pid=1960 uid=1000 result="success"
Revision history for this message
|
#6 |
I found out this is a confirmed but still unresolved bug, for over 12 years now!!!!! Bug 648212
https:/
What are the chances this bug will ever be fixed??
In addition, in NetworkManager there exists functionality for a wifi connection to activate another VPN connection. Unfortunately, at this point, this only works for OpenVPN VPNs (and is badly documented too). I think that the developers should just update this to include Wireguard vpn connections and all other supported types of VPN connections...
Revision history for this message
|
#7 |
Please install the wireguard package. That is why the bug was abandoned.
Wireguard needs its own package to function.
Ubuntu is comprised of snap packages.
https:/
Simple install.
Revision history for this message
|
#8 |
I am not sure I fully understand.
I've configured Network Manager's default/built-in wireguad VPN and it works. It just doesn't auto-start correctly.
You suggest I should install the separate wireguard snap package and not use Network Manager's own?
Is there a reason why? Is network-manager's native wireguard plugin deprecated? Is this canonical's decision?
I find installing a separate package won't integrate well with the network manager! What is the solution to that?
-- From the Network Manager project: https:/
"NetworkManager 1.16.0+ supports WireGuard natively and requires no plugin" (SInce March 2019)
Revision history for this message
|
#9 |
I am having the same issue: Network manager seems to first to connect to wireguard and afterwards to the actual wifi. This does not work properly as the wireguard endpoint cannot be looked up via dns since there is no active internet connection.
PS: I have the wireguard package installed.
Revision history for this message
|
#10 |
Hey Thomas,
Did you install the wireguard snap?
How did you configure network manager to work with the snap wireguard vpn?
Revision history for this message
|
#11 |
his is a related and due to a broader issue with how other VPN types (other than OpenVPN) are handled in NetworkManager.
After a bit of searching upstream, I found out that it has been recently revisited and re-acknowledged as a bug by the current network-manager mainteners, but to my understanding is in nobody's list to fix yet..
https:/
Pitty because it affects a lot of people and because of that we are forced to either use OpenVPN (to get good integration via network-manager gui) or to install other packages to make it automatically start (with the downside of no network-manager integration)..
Revision history for this message
|
#12 |
This question was expired because it remained in the 'Open' state without activity for the last 15 days.