Bug 412795 - Wireguard set up fails with erros -settings lost
Summary: Wireguard set up fails with erros -settings lost
Status: RESOLVED DUPLICATE of bug 479179
Alias: None
Product: plasma-nm
Classification: Plasma
Component: editor (show other bugs)
Version: 5.18.4
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2019-10-09 23:44 UTC by Bernd Müller
Modified: 2024-03-27 03:40 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Müller 2019-10-09 23:44:43 UTC
SUMMARY
KDE 5.16.90
Kubuntu 19.10(beta)

STEPS TO REPRODUCE
1. Trying to configure a wireguard set up. 
2. Entered needed info(?) 
3. Some settings seem wrong ( peer #1 has invalid allowed-ips setting )
OBSERVED RESULTS
4. Gui exits without saving the wrong set up
5. I have to recreate a setup from the scratch.

EXPECTED RESULT
Keep the wrong settings, so users have a chance to re-edit without starting from 0

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.16.90 
KDE Frameworks Version: 5.62
Qt Version: 5.12.4

ADDITIONAL INFORMATION
I am trying to setup following:
 [Interface]
 PrivateKey = blablabla1
 Address = 10.10.10.2
 DNS = 192.168.178.25
 [Peer]
 PublicKey = blablabla2
 Endpoint = blablablabl3:51820
 AllowedIPs = 0.0.0.0/0, 192.168.178.0/24
 PersistentKeepalive = 25

Somehow...I am not able to enter these infos into the Gui without killing it, though I must confess that I am a little confused by the GUIs options.
Comment 1 kde 2020-01-11 23:35:24 UTC
I see the same issue, but with

AllowedIPs = 0.0.0.0/0, ::/0

It seems like the config dialog only accepts one single AllowedIPs entry.
Comment 2 Bernie Innocenti 2020-04-27 15:03:32 UTC
I'm experiencing this bug on Arch Linux with plasma-nm 5.18.4.1-1,networkmanager-qt 5.69.0-2 and networkmanager 1.22.11dev+36+g6abf71f05-1.

After closing the New Connection window, I see this notifaction:

 Failed to add connection XXX
 connection.interface-name: 'XXX': interface name contains an invalid character
Comment 3 Bernie Innocenti 2020-04-27 15:07:34 UTC
Looks like the "Connection name" must not contain spaces.

So there are three problems:

1) this isn't discoverable at all
2) the default interface name is already invalid! :-)
3) validation should be done before closing the "New Connection" window to avoid losing the input
Comment 4 Bernd Müller 2020-04-28 08:04:32 UTC
"Looks like the "Connection name" must not contain spaces."

That was it. Instead of using the default entry proposed by nm-manager I entered a single word "wireguard" and the UI did not crash on me and works as expected. 
Thanks for the finding!
Comment 5 Bernd Müller 2020-04-28 08:09:07 UTC
"AllowedIPs = 0.0.0.0/0, ::/0

It seems like the config dialog only accepts one single AllowedIPs entry."

This is also true for me. Just one entry is allowed in "AllowedIPS" :-/
Comment 6 Simon Westersund 2021-03-22 21:47:32 UTC
Good catch with the spaces! I would suggest that the default name is changed, since nm-plasma suggests "New wireguard connection" by default, which would fail.

Another usability issue I found was that the name is not allowed to exceed 15 characters. That is also probably an easy thing to validate as the user types the connection name.

I'm using KDE Neon with the following versions:
Plasma: 5.21.3
Frameworks: 5.80.0
Qt version: 5.15.2
Kernel: 5.8.0-45-generic
OS Type: 64-bit
Graphics platform: Wayland
Comment 7 cen 2024-01-26 17:17:45 UTC
+1 here.. this is not a good experience. I had to find this bug report through google to figure out what is going on.

Semi-related, is it possible to import a wireguard .conf somehow? Some search results and bugs imply this is possible but I only see OpenVPN import option when trying to add a new connection.
Comment 8 Stephen Robinson 2024-03-22 18:24:38 UTC
I experienced this too, and was very frustrated by it (especially the default name being invalid and losing my config). I thought that I could add a little bit of explanation to it. The name of the connection is being used as the Linux interface name (The list of names that you get if you type "ip link" at a terminal).

AFAIK, other VPN types (such as OpenVPN) in the network manager don't do this. I have an OpenVPN connection up right now, and it gets the interface name "tun0". This has nothing to do with the name that I put in the network manager.

The consistent behavior would be to have the wireguard network get named something like "wg0" regardless of what it is called in the network manager. On the other hand having the Linux interface get a nice name is really cool. I think the ideal would be if there was "interface name" field in the wireguard setup UI, and the connection name was decoupled from the interface name.
Comment 9 Stephen Robinson 2024-03-22 20:59:05 UTC
I looked at the other network-manager editors (eg nm-connection-editor), and they do include a separate "interface" field that is distinct from the name. I have looked into the plasma-nm repo, and I think I have my head wrapped around how to make this change.

I haven't done any KDE work before, so I'm getting kdesrc-build set up. Then I am going to take a crack at fixing this issue.
Comment 10 Stephen Robinson 2024-03-25 22:57:49 UTC
I have created a merge-request to resolve this: https://invent.kde.org/plasma/plasma-nm/-/merge_requests/339
Comment 11 Antti Savolainen 2024-03-27 02:06:44 UTC
Stephen, can you bring your commit to the duplicate report?

*** This bug has been marked as a duplicate of bug 479179 ***
Comment 12 Stephen Robinson 2024-03-27 03:33:47 UTC
Antti, I changed the BUG number in my merge request and commit to 479179.
Comment 13 Antti Savolainen 2024-03-27 03:40:46 UTC
Nice. Good to have them all in one place.