I’m trying to set up a client using StrongSwan + GNOME Settings (NetworkManager / nmcli) for my Azure Point-to-Site Basic SKU IKEv2 VPN on a fresh Fedora 44 install, without
disabling SELinux. I’d like the method to stay as close as possible to the official Microsoft guide:
→ https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-vpn-client-certificate-ike-linux
Also found this older Fedora discussion that looks related but doesn’t quite match my symptoms:
→ https://discussion.fedoraproject.org/t/after-upgrade-to-fedora-32-strongswan-vpn-issue/70501
The same VPN connects fine from Windows, macOS, and from my previous Ubuntu install on the same hardware.
My environment
- Fedora 44 Workstation, Linux kernel
7.0.9-202.fc44, SELinux Enforcing NetworkManager 1.56.0-1.fc44,NetworkManager-strongswan 1.6.0-12.fc44,strongswan 6.0.4-2.fc44update-crypto-policies --show→DEFAULT- VPN: Azure VPN Gateway, Basic SKU, IKEv2 only, certificate auth (self-signed root CA uploaded to Azure; X.509 client cert + 2048-bit RSA PKCS#8 key, unencrypted)
To anyone who might want to mention that the Azure Basic SKU VPN Gateway won’t support the IKEv2 protocol, please have a look here; unfortunately there are many contradictory documentation on Microsoft’s resources.
Also, if you’re curious and want to set it up for yourself and are following this guide but can’t see the IKEv2 protocol option on Azure Portal, use this workaround.
What I did
sudo dnf install strongswan tpm2-abrmd strongswan-charon-nm NetworkManager-strongswan-gnome
install -m 0755 -Z -d ~/.cert
install -m 0755 -Z -d ~/.cert/myvpn
install -m 0644 -Z "/path/to/downloaded/azure/vpnclientconfiguration/Generic/VpnServerRoot.cer_0" ~/.cert/myvpn/VpnServerRoot.cer
install -m 0644 -Z "/path/to/generated/azure/vpn/client/Cert.pem" ~/.cert/myvpn/client-cert.pem
install -m 0600 -Z "/path/to/generated/azure/vpn/client/Key.pem" ~/.cert/myvpn/client-key.pem
sudo restorecon -RvF ~/.cert
Result:
$ ls -laZR ~/.cert
.cert:
drwxr-xr-x. 3 myuser myuser unconfined_u:object_r:home_cert_t:s0 4096 .
drwx------. 35 myuser myuser unconfined_u:object_r:user_home_dir_t:s0 4096 ..
drwxr-xr-x. 2 myuser myuser unconfined_u:object_r:home_cert_t:s0 4096 myvpn
.cert/myvpn:
-rw-r--r--. 1 myuser myuser unconfined_u:object_r:home_cert_t:s0 1200 client-cert.pem
-rw-------. 1 myuser myuser unconfined_u:object_r:home_cert_t:s0 1704 client-key.pem
-rw-r--r--. 1 myuser myuser unconfined_u:object_r:home_cert_t:s0 914 VpnServerRoot.cer
Then following the GUI Steps of the Microsoft guide, opened GNOME Settings → Network → Add VPN → IPsec/IKEv2 (strongswan) and added the following:
The server and client certificate files were imported from the
~/.cert/myvpn/ directory. Everything else (the Algorithms section and all the other tabs) were left unchanged and in most cases empty.
The issue I ran into
When I tried to connect to it using GUI toggle, it wouldn’t turn on and immediately switches off; and when I tried to turn it on with nmcli, I got the following logs in the console:
$ sudo nmcli general logging level debug
$ nmcli general logging
LEVEL DOMAINS
DEBUG PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,TEAM,CONCHECK,DCB,DISPATCH,AUDIT,SYSTEMD,PROXY
$ nmcli connection up myvpn
Error: Connection activation failed: No valid secrets
Hint: use 'journalctl -xe NM_CONNECTION=c8259051-72b6-443f-a718-35479d4744b8 + NM_DEVICE=enp70s0' to get more details.
$ journalctl -xe NM_CONNECTION=c8259051-72b6-443f-a718-35479d4744b8 + NM_DEVICE=enp70s0
May 21 22:59:37 MyComputerHostname NetworkManager[1612]: <info> [1779429577.6508] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: starting strongswan
May 21 22:59:37 MyComputerHostname NetworkManager[1612]: <warn> [1779429577.6564] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: plugin NeedSecrets request #1 failed: GDBus.Error:org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty: Failure creating the temporary file
May 21 23:50:38 MyComputerHostname NetworkManager[1612]: <debug> [1779432638.2233] ndisc-lndp[0x7f735c00cab0,"enp70s0"]: processing libndp events
May 21 23:50:38 MyComputerHostname NetworkManager[1612]: <debug> [1779432638.3204] ndisc-lndp[0x7f735c00cab0,"enp70s0"]: processing libndp events
May 21 23:50:42 MyComputerHostname NetworkManager[1612]: <debug> [1779432642.9932] device[30c479a3a8c2afdd] (enp70s0): add_pending_action (1): 'activation-16'
May 21 23:50:42 MyComputerHostname NetworkManager[1612]: <debug> [1779432642.9933] active-connection[cefeeab6d1ead33d]: constructed (NMVpnConnection, version-id 16, type managed)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <info> [1779432643.0060] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: starting strongswan
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0060] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: starting: watch D-Bus service org.freedesktop.NetworkManager.strongswan
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0060] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: set state: prepare (was waiting)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0060] active-connection[cefeeab6d1ead33d]: set state activating (was unknown)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0061] active-connection[cefeeab6d1ead33d]: check-controller-ready: not signalling (state activating, no controller)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0085] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: starting: VPN service has PID 234994
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0306] platform: (enp70s0) signal: address 4 changed: 192.168.1.15/24 brd 192.168.1.255 lft 50364sec pref 50364sec lifetime 91998-55962[86400,86400] dev 2 flags noprefixroute src kernel
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0310] platform: (enp70s0) signal: address 6 changed: 2601:646:a000:8d0e:fb85:a6a8:932:8d5b/64 lft 252933sec pref 252933sec lifetime 91998-91960[252971,252971] dev 2 flags noprefixroute src kernel
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0452] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: set state: need-auth (was prepare)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0453] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: secrets: requesting VPN secrets pass #1
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0454] settings-connection[880c56810e638783,c8259051-72b6-443f-a718-35479d4744b8]: (vpn:0x55ba894daa90) secrets requested flags 0x80000004 hints '(none)'
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0456] settings-connection[880c56810e638783,c8259051-72b6-443f-a718-35479d4744b8]: (vpn:0x55ba8956a900) existing secrets returned
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0456] settings-connection[880c56810e638783,c8259051-72b6-443f-a718-35479d4744b8]: (vpn:0x55ba8956a900) secrets request completed
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0457] settings-connection[880c56810e638783,c8259051-72b6-443f-a718-35479d4744b8]: (vpn:0x55ba8956a900) new agent secrets processed
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0461] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: secrets: asking service if additional secrets are required
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <warn> [1779432643.0510] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: plugin NeedSecrets request #1 failed: GDBus.Error:org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty: Failure creating the temporary file
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0510] vpn[0x55ba894865e0,c8259051-72b6-443f-a718-35479d4744b8,"myvpn"]: set state: failed (was need-auth)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0510] active-connection[cefeeab6d1ead33d]: set state deactivated (was activating)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0511] active-connection[cefeeab6d1ead33d]: check-controller-ready: not signalling (state deactivated, no controller)
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0511] device[30c479a3a8c2afdd] (enp70s0): remove_pending_action (0): 'activation-16'
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.0514] active-connection[cefeeab6d1ead33d]: disposing
May 21 23:50:43 MyComputerHostname NetworkManager[1612]: <debug> [1779432643.3300] ndisc-lndp[0x7f735c00cab0,"enp70s0"]: processing libndp events
May 21 23:50:49 MyComputerHostname NetworkManager[1612]: <debug> [1779432649.0737] ndisc-lndp[0x7f735c00cab0,"enp70s0"]: processing libndp events
