What "Should" Happen I want traffic to Google to go through en0 (Mac) and hit gateway A (let's say IP = 123.456.789.000). I have another route setup for en3 and I don't want to mess with that.
Tried:
sudo route add -host 173.194.121.54 123.456.789.000 -ifscope en0 Output from that was:
netstat -nr showed:
Destination Gateway Flags Refs Use Netif Expire default 234.567.89.10 UGSc 35 14 en3 default 123.456.789.000 UGSc 35 14 en0 127 127.0.0.1 UCS 0 0 lo0 127.0.0.1 127.0.0.1 UH 13 6073 lo0 173.194.121.54 123.456.789.000 UGHSI 0 0 en0 Groovy, no?
Tried ping, Google unreachable. Tried traceroute and saw:
traceroute to 173.194.121.54 (173.194.121.54), 64 hops max, 52 byte packets 1 234.567.89.10 (234.567.89.10) 1.043 ms !N 0.883 ms !N 0.862 ms !N No bueno.
I would expect to see traceroute start at the right gateway (123.456.789.000) but instead it's going through the wrong gateway and I'd guess the wrong device.
Where did I go wrong?
Edit: Apologies, I've been trying a lot of things, hard to tell one output from the other.
-ifscopebut I found some information about it here and it I would say it doesn't have anything to do with what you want. Have you tried without that flag?dev <device>and also edit your question because I think there is something wrong with it. You added a route to17.194.121/24via123.456.789.000and you ended up with a routng table entry for173.194.121/24via10.10.171.254. This seems like you combined theroutecommand andnetstatoutput from completely different trials.Hflag inUGHSImeans 173.194.121.0 is being interpreted as a host address, not a net address.What was the exactroutecommand you typed?