Delete Mac route at startup

Everytime our Mac server boots up it adds in a route for 192.168.0/16.  When the server reboots I have to go in and delete this route.  Is there anyway I can have it automatically delete on startup, or not create it at all?
NorthAmericanAsked:
Who is Participating?
 
woolnoirConnect With a Mentor Commented:
5. Create a file named "StartupParameters.plist" containing the following :

{
Description      = "Remove static routing tables";
Provides      = ("RemoveRoutes");
Requires      = ("Network");
OrderPreference      = "None";
}
6. chmod 755 RemoveRoutes StartupParameters.plist
7. Then reboot your computer, it's done.
0
 
woolnoirCommented:
The fact that its adding a route means it must be under the impression the network exists somewhere on one of its interfaces... is that range used anywhere within your organization ? or do you simply want it removed anyway ?

0
 
NorthAmericanAuthor Commented:
We have a 192.168.2.4 address set up to go to "lo4", but the route it is adding is 192.168.0/16.  We have other things on the network in that range that need to go out the default "en0" connection which is why I always have to delete the 192.168.0/16 route to be able to get to them.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
woolnoirCommented:
what's the subnet mask set to on the lo4 interface ? is it set as a /16 ?
0
 
NorthAmericanAuthor Commented:
It's the loopback interface.  It's 255.255.255.255
0
 
woolnoirCommented:
and its not an option to have a different address on the lo4 interface ? it would appear that OSX is adding the route based on this, i admit that ive not seen this in the wild before.. I'll have a think.
0
 
NorthAmericanAuthor Commented:
Oops, the interface is actually lo0, if that makes any difference
0
 
woolnoirCommented:
check this page http://discussions.apple.com/message.jspa?messageID=5697532

the guy gives a nice post about adding static routes at startup, we could follow the reverse i.e

1. cd /Library/StartupItems
2. mkdir RemoteRoutes
3. cd RemoveROutes
4. Use your favorite editor (I recommend vi) to create a file named "RemoveRoutes" containing the following :


#!/bin/sh
#Tonyee, Tuesday, October 30, 2007

. /etc/rc.common

StartService ()
{
ConsoleMessage "Removing Static Routing Tables"
route del -net 192.168.0.0 255.255.0.0

}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService "$1"

Open in new window

0
 
woolnoirCommented:
then  ( sorry need to have multiple posts)
0
 
woolnoirCommented:
that should work - i'm altering some guys script, and im not logged into OSX currently but it 'should' work. As always, take care :)
0
 
woolnoirCommented:
and its route delete rather than route del :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.