tonarino / innernet

A private network system that uses WireGuard under the hood.
https://blog.tonari.no/introducing-innernet
MIT License
4.93k stars 184 forks source link

There's support for wireguard-rs? #288

Open hardBSDk opened 11 months ago

hardBSDk commented 11 months ago

Can I use it instead of wireguard-go ? I read that you plan to migrate to it once it's ready, but can I use it as an optional flag?

If not, consider it a feature request, allow the usage of two WireGuard user-space implementations with flags.

mcginty commented 11 months ago

Hey @hardBSDk, you can use any userspace implementation of WireGuard you'd like via the WG_USERSPACE_IMPLEMENTATION or WG_QUICK_USERSPACE_IMPLEMENTATION environment variables. It just defaults to wireguard-go if those aren't set, as it's the most mature and available implementation currently.

hardBSDk commented 11 months ago

@mcginty Where the usage of them is documented? it's a WireGuard variable or Innernet variable?

mcginty commented 11 months ago

The code is here: https://github.com/tonarino/innernet/blob/main/wireguard-control/src/backends/userspace.rs#L262-L273

It's not documented, unfortunately. That should probably change... WG_QUICK_USERSPACE_IMPLEMENTATION initially existed for wg-quick, and I wrote it this way to respect that variable if it's set globally.