Zend certified PHP/Magento developer

macos route IP through LAN gateway

I’m trying to handle a route on MacOS, the linux ip’s alternative is:

ip route add 203.0.113.2 via 192.168.1.1 dev eth0
ip route del 203.0.113.2 via 192.168.1.1 dev eth0

Explaining: The default via 192.168.1.1 dev eth0 line indicates that the system uses 192.168.1.1 as its default gateway, connected through its eth0 network interface. To make sure Endpoint A will use this gateway for its udp2raw tunnel with Endpoint B, instead of the WireGuard tunnel, we need to add an explicit route for Endpoint B’s public IP address (203.0.113.2), like the above.

I’m new to this whole concept not only on MacOS but also linux.

Thanks to anyone who contributes to this question, in advance.