0

OS/X does most of its routing based on the order of the interfaces in 'Network Preferences'.

I need to separate traffic, so I've put the default route first, and then routed traffic to the second interface.

The problem is that, after using the route command, I start getting these errors either in the browser, or traceroute saying 'Cannot allocate memory'.

So route seems to be doing something wrong.

Here is the detail:

I've got two interfaces, in this order:

  1. Wi-Fi connection to Apple time capsule that links to the internet - 10.0.1.9

  2. LAN connection to ISP that links to the internet - 10.0.2.250

This works perfectly well, however, I would like to rout traffic through the second link, not just have it as a fail-over.

So, I use the route command, like this:

route -n add -host 197.242.144.171 10.0.2.250 route -n add -host 197.242.144.175 10.0.2.250 route -n add -host 173.194.41.182 10.0.2.250

This doesn't give any errors and a netstat -nr shows:

197.242.144.171 10.0.2.250 UGHS 0 1 en0 197.242.144.175 10.0.2.250 UGHS 0 0 en0 173.194.41.182 10.0.2.250 UGHS 0 12 en0

If, though, I try trace route, this is what I get:

traceroute 197.242.144.175 traceroute to 197.242.144.175 (197.242.144.175), 64 hops max, 52 byte packets traceroute: sendto: Cannot allocate memory 1 traceroute: wrote 197.242.144.175 52 chars, ret=-1

Any suggestions??

Peter Brooks
  • 101
  • 2

1 Answers1

1

I just ran across this too. For me it was a wrong ip. In your route commands, the gateway should be the interface on the other end of the connection - that is, don't use 10.0.2.250 as the gateway, use the ip at the other end (10.0.2.1?).

My guess for what is happening is that the address mapping goes into a loop, which is why it can't allocate more memory. I see this is an old question but I ran across it too, and didn't find a good explanation anywhere.

rwy
  • 11
  • 1
  • That's an interesting theory. I'll try it out by creating a looping address deliberately to see if it gives the same error. – Peter Brooks Oct 23 '14 at 23:00