Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to add static route on Mac OS. I found good description here Permanent Static Route Mac OS X 10.4.0 and followed the Roark Holz's (roarkh) solution.
Now my problem: sometimes this solution works, sometimes does not.
When it doesn't work I see these messages after boot in the Console Messages log:

06.05.10 9:34:13[1]    *** launchd[1] has started up. ***  
06.05.10 9:34:46[30] Adding Static Route to 10.152
06.05.10 9:34:46[30] route: writing to routing socket: Network is unreachable
06.05.10 9:34:46[30] add net gateway Network is unreachable

I want to know what is going on. How this kind of problem can be troubleshooted?

share|improve this question

I think the problem is that the network interfaces haven't been properly activated before the command runs. You may need to do another launchd job to wait before the command runs.

share|improve this answer

I just solved this today.

Create the file /etc/rc.local and write this

sleep 30
route add -net <network, I.E.> <interface, I.E.>

You have to wait until the rest of the network stuff is started.. which is why you are getting the network unreachable error.

You can do this using the plist (which it looks like you are doing) but I have no idea how to do it.

You might try adding the sleep 30 command before the route command in the plist. if that works for you could you document it for the rest of us, Thanks!

share|improve this answer

Make sure the route is set up after the interface corresponding to the net is brought up. If the device in question is configured by a dhcp server either make sure your wifi is activated or the network cable is plugged in or let dhcp set up the static route--given that your dhcp server supports such settings.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .