Benches macOS

1

Routing traffic to specific web sites thr…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi

I have two separate Internet connections connected to a Mac and I'd like one of them (via Ethernet eth0 gateway 192.168.2.1) to serve for just backing up to an remote online storage, and the other one (via Airport en1 gateway 192.168.1.1) for all other Internet traffic.

I tried using "route" from the terminal as follows:

sudo route add -host 98.207.226.113 -interface eth0

(just for testing against the site http://www.whatismyip.org whose IP is 98.207.226.113, to see through which gateway the traffic is routed)

I can see using netstat that the route is added:

$ netstat -rn -f inet

Routing tables

Internet:

Destination Gateway Flags Refs Use Netif Expire

default 192.168.1.1 UGSc 49 0 en1

98.207.226.113 192.168.2.1 UGSc 0 0 eth0

However, the traffic in this case does NOT get routed properly through Ethernet, as if the routing definition I made is ignored.

Any ideas?

Thanks!

1 reply

Sign in or join Beachball Help to reply.

  1. 0

    Azhrei

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You've got Linux on the brain: the Ethernet port is "en0" and not "eth0".

    Whew, that was easy! 😉

    Btw, if you do change the interface you should see the new route at the bottom of the list, since the netmasks are sorted with the most specific at the bottom (opposite the way the Linux
    netstat -rn and
    route commands would sort them).

    Message was edited by: Azhrei