hyprspace icon indicating copy to clipboard operation
hyprspace copied to clipboard

Hyprspace as a valid VPN profile

Open Winterhuman opened this issue 2 years ago • 3 comments

I was wondering if hyprspace could be configured to be a valid VPN profile for NetworkManager?

In NetworkManager, Wireguard and OpenVPN interfaces are listed as valid VPN connections, but, hyprspace's interfaces can't be set as a VPN connection since nmcli states it's not a valid VPN profile when setting connection.secondaries.

Having VPN profile support would make it a lot easier to forward traffic through them without needing to use iptable scripts, however, I'm not sure how much effort is needed to achieve this as I couldn't find any information about how VPNs in NetworkManager work.

Winterhuman avatar Sep 23 '21 17:09 Winterhuman

This would be cool! I don't know what it takes to integrate into NetworkManager and I don't have any experience with it. If anyone wants to research this and take it on as a project I'd be happy to help out where I can.

alecbcs avatar Sep 23 '21 18:09 alecbcs

I'm going to leave some notes here as I find them, I can't code so this is unfortunately something I can't help with, hopefully anyone who finds this issue finds these notes useful in making this feature possible. [Check out the Matrix room for hyprspace as well for more information]

What makes a "valid" VPN?

From what I've been able to gather from this blog post (https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/), VPNs in NetworkManager seem to be defined by connection.type: vpn, however, I'll need to research further to determine if this is the only thing needed for an interface to be a valid VPN profile. Also, this project (https://gitlab.gnome.org/GNOME/NetworkManager-openvpn) may be of help, it creates a tun interface which is a valid VPN profile, looking through the code might help answer how VPN interfaces can be created.

From my current understanding, if hyprspace called nmcli connection add (or whatever the API for this would be) and created a tun interface through NetworkManager with connection.type: vpn then this should work, this would likely need to be manually tested as it seems there really is no documentation on how to do this.

Winterhuman avatar Sep 23 '21 20:09 Winterhuman

Maybe this issue should have the "help wanted" tag assigned to it?

Winterhuman avatar Sep 23 '21 20:09 Winterhuman