Skip to content

Commit

Permalink
(macOS) WireGuard: use interface name for default route (instead of I…
Browse files Browse the repository at this point in the history
…P address)
  • Loading branch information
stenya committed Oct 21, 2024
1 parent eed65d4 commit f4a2ac8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion daemon/vpn/wireguard/wireguard_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ func (wg *WireGuard) setRoutes() error {
}

// sudo route -n add -inet default host_local_IP
if err := shell.Exec(log, "/sbin/route", "-n", "add", "-inet", "default", wg.defaultRouteGatewayIP().String()); err != nil {
//if err := shell.Exec(log, "/sbin/route", "-n", "add", "-inet", "default", wg.defaultRouteGatewayIP().String()); err != nil {
if err := shell.Exec(log, "/sbin/route", "-n", "add", "-inet", "default", "-interface", wg.GetTunnelName()); err != nil {
return fmt.Errorf("adding default route shell comand error : %w", err)
}

Expand Down

0 comments on commit f4a2ac8

Please sign in to comment.