Solved

Delete Mac route at startup

Posted on 2010-11-11
11
1,115 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:NorthAmerican
  • 8
  • 3
11 Comments
 
LVL 20

Expert Comment

by:woolnoir
ID: 34119075
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
 

Author Comment

by:NorthAmerican
ID: 34123652
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
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123661
what's the subnet mask set to on the lo4 interface ? is it set as a /16 ?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:NorthAmerican
ID: 34123746
It's the loopback interface.  It's 255.255.255.255
0
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123762
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
 

Author Comment

by:NorthAmerican
ID: 34123781
Oops, the interface is actually lo0, if that makes any difference
0
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123824
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
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123828
then  ( sorry need to have multiple posts)
0
 
LVL 20

Accepted Solution

by:
woolnoir earned 500 total points
ID: 34123839
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
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123846
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
 
LVL 20

Expert Comment

by:woolnoir
ID: 34123855
and its route delete rather than route del :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question