Hi CodeGenius
Perhaps you could try to force route the communication through different network adapters:
Custom Traffic Routing on macOS
1. Identify Network Adapters
To identify the network interfaces available on your macOS, run the following command in the terminal:
networksetup -listallhardwareports
Or use ifconfig
to list all interfaces:
ifconfig
2. Determine Routing Needs
Decide which traffic you want to route through which network adapter, typically determined by destination IP addresses or subnets.
3. Modify the Routing Table
Use the route
command with sudo
to modify the routing table. For example, to route traffic to a specific IP through a specific adapter:
sudo route add -host 192.168.1.10 -interface en1
To route an entire subnet through an adapter:
sudo route add -net 192.168.1.0/24 -interface en1
4. Set Default Route
To set a default route through a specific adapter:
sudo route change default -interface en1
Replace en1
with your network adapter's identifier.
5. Persistent Routing
The above route
commands do not persist after a reboot. To make them persistent, create a launch daemon or use a startup script.
6. Testing
Test your routing rules with ping
or traceroute
to ensure traffic is routed correctly.
Please replace en1
with the actual identifier of your network adapter and 192.168.1.10
or 192.168.1.0/24
with the actual IP address or subnet you wish to route.