diff --git a/network/lan_test.go b/network/lan_test.go index 20a9cab9..43c989b2 100644 --- a/network/lan_test.go +++ b/network/lan_test.go @@ -25,6 +25,7 @@ func TestNewLAN(t *testing.T) { if err != nil { t.Error("no iface found", err) } + gateway, err := FindGateway(iface) if err != nil { t.Error("no gateway found", err) diff --git a/network/net.go b/network/net.go index afa14822..d6d599c8 100644 --- a/network/net.go +++ b/network/net.go @@ -256,6 +256,11 @@ func FindInterface(name string) (*Endpoint, error) { // return the first one with a valid ipv4 // address that does not loop back for _, iface := range ifaces { + // if name has not been provided, avoid default to a tun interface + if strings.Contains(iface.Name, "tun") { + continue + } + addrs, err := iface.Addrs() if err != nil { fmt.Printf("wtf of the day: %s", err)