Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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    com.apple.launchd[1]    *** launchd[1] has started up. ***  
06.05.10 9:34:46    com.apple.SystemStarter[30] Adding Static Route to 10.152
06.05.10 9:34:46    com.apple.SystemStarter[30] route: writing to routing socket: Network is unreachable
06.05.10 9:34:46    com.apple.SystemStarter[30] add net 10.152.0.0: gateway 192.168.1.234: Network is unreachable

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

share|improve this question

3 Answers 3

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. 192.168.1.0/24> <interface, I.E. 192.168.1.1>

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 192.168.1.0/24 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.