Bug 461319 - WireGuard connection doesn't save persistent-keepalive value.
Summary: WireGuard connection doesn't save persistent-keepalive value.
Status: RESOLVED FIXED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.8
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 13:14 UTC by FingerlessGloves
Modified: 2024-12-18 22:15 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description FingerlessGloves 2022-11-02 13:14:29 UTC
SUMMARY
I've got a WireGuard profile, when I add a `Persistent Keepalive` to a peer via the the applet, press apply. The setting doesn't actually apply, if you reopen the applet then the connection, the field is then blank again. You don't need to connect with the profile, just try setting it and then close the applet window and then go back in to check it's applied.

If you set the `persistent-keepalive` directly in the .connection file and reload network manager. It'll then show in the NetworkManager Applet, but making any changes to the connection to the peers list will cause the `persistent-keepalive` to be unset once again using the applet.

STEPS TO REPRODUCE
1. Open WireGuard connection profile in nm-applet
2. Go to the `WireGuard Interface` tab
3. Click `peers`
4. Add value like `25` to `Persistent Keepalive`
5. Click `OK` to the `Peer Properties` window
6. Click `Ok`  to the `Connections- System Settings` window
7. Open WireGuard connection profile in nm-applet
8. Go to the `WireGuard Interface` tab
9. Click `peers`
10. See value wasn't applied.

OBSERVED RESULT
`persistent-keepalive` isn't set

EXPECTED RESULT
`persistent-keepalive` should be set to defined value

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 36
KDE Plasma Version:  5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
System is fully up to date, as of writing this bug.
Comment 1 Bug Janitor Service 2022-11-02 13:34:03 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.

If you're unsure how to do this, contact your distributor about it.
Comment 2 FingerlessGloves 2022-11-02 18:01:01 UTC
Also happens on Fedora 37

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 37
KDE Plasma Version:  5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Comment 3 sn 2022-12-07 03:52:52 UTC
Bug exists on Ubuntu 20.04.5 LTS with KDE plasma version 5.18.8.

Note: adding "persistent-keepalive=25" under the [wireguard-peer. ...] heading in /etc/NetworkManager/system-connections/<wg.nmconnection> does not fix the issue for me. i.e. I cannot establish a functional wireguard tunnel this way.  However, `sudo wg-quick up </etc/wireguard/wg_conf_file_name>` (which has PersistentKeepAlive = 25 under the [Peer] heading does create a functional wireguard tunnel.
Comment 4 Joshua J. Kugler 2023-01-27 01:17:23 UTC
I am running 5.26.5-0xneon+22.04+jammy+release+build17 and this bugs still exists.
Comment 5 Joshua J. Kugler 2023-01-27 01:46:44 UTC
@sn: 

I added "persistent-keepalive=21" to the [wireguard-peer.xxxxx] section and ran `nmcli connection reload`. Restarted conenction via plasma applet, and `wg show` now showed the keep alive value.
Comment 6 Boltronics 2024-06-19 04:12:13 UTC
Confirming that this is still an issue after upgrading to KDE Plasma 6.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-arch1-1 (64-bit)
Graphics Platform: Wayland

I can also confirm that the work-around others have posted here still works. Namely, adding an entry like `persistent-keepalive=25` under the applicable `[wireguard-peer.XXXXX]` section of the connection's .nmconnection file found under /etc/NetworkManager/system-connections/, running `nmcli connection reload`, establishing a VPN connection via the applet and finally confirming the change via `wg show`.

The value of 25 (for this example) will also now present itself in the GUI in the applicable Peers section, and seems to persist if there are no further connection changes made via the GUI that are saved.
Comment 7 Bug Janitor Service 2024-12-17 18:22:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/395
Comment 8 Nicolas Fella 2024-12-18 22:01:36 UTC
Git commit 88ac65b634826e31615b6b04a845458da2d5a3c4 by Nicolas Fella, on behalf of Adrian Thiele.
Committed on 18/12/2024 at 21:57.
Pushed by nicolasfella into branch 'master'.

Fix saving keepalive interval for WireGuard

NetworkManager expects the persistent-keepalive value to be an uint
and just ignores it if it is not.

M  +1    -1    libs/editor/settings/wireguardpeerwidget.cpp

https://invent.kde.org/plasma/plasma-nm/-/commit/88ac65b634826e31615b6b04a845458da2d5a3c4
Comment 9 Nicolas Fella 2024-12-18 22:14:28 UTC
Git commit f35e99f31c50d49338e688a0c1c0be3c1c4dfe79 by Nicolas Fella, on behalf of Adrian Thiele.
Committed on 18/12/2024 at 22:14.
Pushed by nicolasfella into branch 'Plasma/6.2'.

Fix saving keepalive interval for WireGuard

NetworkManager expects the persistent-keepalive value to be an uint
and just ignores it if it is not.
(cherry picked from commit 88ac65b634826e31615b6b04a845458da2d5a3c4)

M  +1    -1    libs/editor/settings/wireguardpeerwidget.cpp

https://invent.kde.org/plasma/plasma-nm/-/commit/f35e99f31c50d49338e688a0c1c0be3c1c4dfe79