Bug 459397

Summary: Wireguard connection does not close correctly, no internet
Product: [Plasma] plasmashell Reporter: fw.smit01
Component: Networking in generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fw.smit01, jgrulich
Priority: NOR    
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description fw.smit01 2022-09-19 14:25:33 UTC
SUMMARY
Wireguard connections that are started via a wg-quick systemd service automatically get detected by networkmanager as a wireguard interface. I get notifications for when it's started and stopped via the systemctl commands.
There are actually two things that don't work correctly. These are probably related, so i put them in one issue:
- Upon stopping the service via the command, the VPN disappears out of the list
- When stopping the connection via the "disconnect" button in the GUI, it does not close the VPN properly, resulting in no internet

STEPS TO REPRODUCE FIRST ISSUE

1. Start a wg-quick wireguard VPN (example: systemctl start wg-quick@wg0). A notification appears that the VPN has started and it appears in the VPN list.
2. Stop the vpn with a similar command (example: systemctl stop wg-quick@wg0)

OBSERVED RESULT

The VPN is not in the list anymore.


EXPECTED RESULT

The VPN stays in the list.

STEPS TO REPRODUCE SECOND ISSUE

1. Start a wg-quick wireguard VPN (example: systemctl start wg-quick@wg0). A notification appears that the VPN has started and it appears in the VPN list.
2. Stop the vpn with the "disconnect" button in the plasma applet.

OBSERVED RESULT

Internet doesn't work anymore.

> ip addr show wg0

wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 

EXPECTED RESULT

The wg0 device is actually removed. I think this is easiest to achieve by just using the systemctl command.

> ip addr show wg0

Device "wg0" does not exist.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.25.5.
(available in About System)

Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.19.9-200.fc36.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 15,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: HP
Product Name: HP ZBook Studio G5

ADDITIONAL INFORMATION
Comment 1 fw.smit01 2023-02-22 13:57:24 UTC
For me this is not an issue anymore. I followed the tutorial on https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ and imported the wg-quick profile into networkmanager. Now it works great. The magic line was:

sudo nmcli connection import type wireguard file "/etc/wireguard/wg0.conf"
Comment 2 Ben Cooksley 2024-12-23 18:23:41 UTC
Bulk transfer as requested in T17796