First I would like to thank Giaguara for the previous post, it has helped me more than any other I could find in setting up a persistant static route on Tiger.
I did run into a few gotchas that may have to do with changes Apple has made with updates or just unknown differences in our installations so I thought I would post my method in the hopes that it might help someone else.
I am assuming that anyone digging this deep into the system has probably enabled the root user so everything that follows assumes that you have opened a Terminal and typed 'su' to become root. Of course be very careful whenever doing anything as root on your system.
The first problem I ran into was that there was no /System/Library/StartupItems/NetworkExtensions on my system so I did not start with a copy of something Apple provided as Giaguara did.
So here we go...
I believe that /Library/StartupItems is a more correct location for 3rd party (non Apple) startup scripts so I am putting mine there instead of /System/Library/StartupItems.
Code:
mkdir AddRoutes
cd AddRoutes
Use your favorite editor (I recommend vi or nano) to create a file named "AddRoutes" containing the following being careful to replace the (in blue) "route" command with your route:
Code:
#!/bin/sh
# Set up static routing tables
# Roark Holz, Thursday, April 6, 2006
. /etc/rc.common
StartService ()
{
ConsoleMessage "Adding Static Routing Tables"
[COLOR="Blue"]route add -net 192.168.3.0/24 192.168.0.180[/COLOR]
}
StopService ()
{
return 0
}
RestartService ()
{
return 0
}
RunService "$1"
Then, create the file "StartupParameters.plist" containing the following:
Code:
{
Description = "Add static routing tables";
Provides = ("AddRoutes");
Requires = ("Network");
OrderPreference = "None";
}
Now we set up the proper permissions:
Code:
chmod 755 AddRoutes StartupParameters.plist
That's it. The stuff in "Resources/English.lproj" appears to be unnecessary, at least this works fine on my system (10.4.5 running on an iMac G5).
Reboot your computer and your route should be active. You can verify with a 'netstat -r' command on the Terminal.
Roark Holz