2

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.

9
  • I am not familiar with -ifscope but 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? Commented Apr 22, 2015 at 15:35
  • You can't have two default gateways (at least, not like this). The definition of a "default gateway" is the gateway that is used if there is no explicit route. Singular. Commented Apr 22, 2015 at 15:35
  • 1
    @JasonNichols Please don't use dev <device> and also edit your question because I think there is something wrong with it. You added a route to 17.194.121/24 via 123.456.789.000 and you ended up with a routng table entry for 173.194.121/24 via 10.10.171.254. This seems like you combined the route command and netstat output from completely different trials. Commented Apr 22, 2015 at 15:41
  • 1
    you still have 17.194.121/24 (in the route command) vs. 173.194.121/24 (in the netstat output) Commented Apr 22, 2015 at 16:43
  • 2
    The H flag in UGHSI means 173.194.121.0 is being interpreted as a host address, not a net address.What was the exact route command you typed? Commented Apr 22, 2015 at 17:23

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.