netclient icon indicating copy to clipboard operation
netclient copied to clipboard

Netclient v0.21.0 on Windows - False Egress Routes

Open pankios opened this issue 2 years ago • 0 comments

The netclient do not passes correctly the external routes of the egress nodes on my network.

The problem is on file wireguard_windows.go

 mask := net.IP(addr.Network.Mask)   slog.Info("adding route to interface", "route", fmt.Sprintf("%s -> %s", addr.IP.String(), addr.Network.String())) cmd := fmt.Sprintf("route -p add %s MASK %v %s", addr.IP.String(),mask,addr.IP.String()) _, err := ncutils.RunCmd(cmd, false) if err != nil { slog.Error("failed to apply", "egress range", addr.IP.String()) }

The command that is created above route -p add %s MASK %v %s", addr.IP.String(),mask,addr.IP.String()

Passes two times the addr.IP.String() that is the windows netmaker interface address

it should be like following

route -p add %s MASK %v %s", addr.Network.String(),mask,addr.IP.String()

The wrong route that is produced it is indeed passing to the routing table of the windows machine

pankios avatar Sep 24 '23 12:09 pankios