Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Permanently add routes to iMac running OS 10.7

My iMac gets its ip address and default gateway from a windows DHCP server.


It fails to pick up the static routes from the DHCP server for my other internal network, which is not accessable via the default gateway device.


I can make it so that the computer can picj up these routes but then the info is removed on reboot!

Need to find a way of being able to permenantly adding the routes to the Mac either through a specific file or startup script

Other ones i have tried do not seem to work for OS 10.7


If anyone can help that would be great!

iMac, Mac OS X (10.7)

Posted on Nov 28, 2011 6:57 AM

Reply
2 replies

Dec 12, 2011 5:04 AM in response to mongoink

Hi,


Not sure if you have fixed this, but I'd use launchd to create the route on startup.

If you create a text file in /Library/LaunchDaemons/local.imac.route.plist

with:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Label</key>

<string>local.imac.route</string>

<key>OnDemand</key>

<false/>

<key>ProgramArguments</key>

<array>

<string>route</string>

<string>add</string>

<string>[NETWORK/16]</string>

<string>[GATEWAY]</string>

</array>

<key>KeepAlive</key>

<false/>

<key>RunAtLoad</key>

<true/>

<key>ServiceIPC</key>

<false/>

<key>UserName</key>

<string>root</string>

</dict>

</plist>


You need to replace [NETWORK/16] with the network you are trying to add, like 10.15.14.0/24 or 10.0.0.0/8

and [GATEWAY] with the IP address of the gateway to use like 10.11.12.13


Then as root (login as an admin user and use "sudo su -" to become root) type:

launchctl load /Library/LaunchDaemons/local.imac.route.plist


You should be up and running.

Permanently add routes to iMac running OS 10.7

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.