naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/
MIT License
680 stars 32 forks source link

Added an option to use wireguard userspace implementation #43

Closed baselsayeh closed 3 years ago

baselsayeh commented 3 years ago

This will allow servers with older kernel versions, or servers that doesn't have (and cant, like openvz) wireguard module loaded

naggie commented 3 years ago

Thanks @baselsayeh -- is there a standard userspace implementation? I presume it would appear as a wg bin as standard. Therefore perhaps it's best to attempt the kernel mode interface add, and fall back to a discovered userspace one?

baselsayeh commented 3 years ago

Thanks @baselsayeh -- is there a standard userspace implementation? I presume it would appear as a wg bin as standard. Therefore perhaps it's best to attempt the kernel mode interface add, and fall back to a discovered userspace one?

Yes, there is Wireguard-go https://git.zx2c4.com/wireguard-go/about/ and it is discouraged to use it if a kernel implementation is available, but required if the kernel does not provide the interface.

I was also thinking to put the binary name as an environment variable, and defaults to wireguard-go if variable is empty. (That whats wg-quick does, Line 94 of wg-quick )

What do you think?