Mac priorities default route by network services order, but VPN connections have priority regardless of that order:
https://support.apple.com/guide/mac-help/mchlp2711/mac
You can try to create in Mac Wireguard config PostUp script which sets route for that conflicted subnet to be routed over Wireguard interface but better solution is to change VPN subnet to some 10.0.0.0/8 address range at some point to be safe.
Example route commands on Mac:
sudo route -q -n add -inet 192.168.1.0/24 -interface <wg_interface> - this will route 192.168.1.0/24 subnet over Wireguard interface
or you can route only specific server ip addresses:
sudo route -q -n add -host <server1_ip> -interface <wg_interface>
sudo route -q -n add -host <server2_ip> -interface <wg_interface>
...
Note: Adding routes requires sudo, you will need to edit /etc/sudoers (like on Linux) to be non-ineractive for script usage, for that see https://jefftriplett.com/2022/enable-su ... -on-macos/
https://support.apple.com/guide/mac-help/mchlp2711/mac
But that's only default route, windows maybe have different behavior and priorities interface subnet route based which interface becomes up in order.You can’t change the order of virtual private network (VPN) connections because they already take priority over non-VPN connections.
You can try to create in Mac Wireguard config PostUp script which sets route for that conflicted subnet to be routed over Wireguard interface but better solution is to change VPN subnet to some 10.0.0.0/8 address range at some point to be safe.
Example route commands on Mac:
sudo route -q -n add -inet 192.168.1.0/24 -interface <wg_interface> - this will route 192.168.1.0/24 subnet over Wireguard interface
or you can route only specific server ip addresses:
sudo route -q -n add -host <server1_ip> -interface <wg_interface>
sudo route -q -n add -host <server2_ip> -interface <wg_interface>
...
Note: Adding routes requires sudo, you will need to edit /etc/sudoers (like on Linux) to be non-ineractive for script usage, for that see https://jefftriplett.com/2022/enable-su ... -on-macos/
Statistics: Posted by optio — Wed Jan 31, 2024 11:25 pm