From b024e249c71bee35273d8fcb3936f46af537b295 Mon Sep 17 00:00:00 2001 From: afeiszli Date: Tue, 21 Sep 2021 20:50:32 -0400 Subject: [PATCH] starting userspace --- netclient/local/local.go | 6 ++++-- netclient/main.go | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/netclient/local/local.go b/netclient/local/local.go index 40f7fdfd..4eccb524 100644 --- a/netclient/local/local.go +++ b/netclient/local/local.go @@ -7,7 +7,7 @@ import ( "net" "runtime" "strings" - + "os/exec" "github.com/gravitl/netmaker/netclient/ncutils" ) @@ -54,7 +54,9 @@ func SetIPForwardingMac() error { func IsWGInstalled() bool { out, err := ncutils.RunCmd("wg help", true) if err != nil { - return false + _, err1 := exec.LookPath("wireguard-go") + _, err2 := exec.LookPath("boringtun") + return err1 == nil || err2 == nil } return strings.Contains(out, "Available subcommand") } diff --git a/netclient/main.go b/netclient/main.go index e8d91483..5c69679b 100644 --- a/netclient/main.go +++ b/netclient/main.go @@ -342,8 +342,12 @@ func main() { _, err = exec.LookPath("wg") if err != nil { - log.Println(err) - log.Fatal("WireGuard not installed. Please install WireGuard (wireguard-tools) and try again.") + userspace := os.Getenv("WG_QUICK_USERSPACE_IMPLEMENTATION") + if userspace == "" { + log.Println(err) + log.Fatal("WireGuard not installed. Please install WireGuard (wireguard-tools) and try again.") + } + ncutils.PrintLog("Running with userspace wireguard: "+userspace, 0) } } if !ncutils.IsKernel() {