Solved

Delete Mac route at startup

Posted on 2010-11-11
11
1,111 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
 

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Tor browser 15 100
mac operating system 8 89
Is macOS Sierra worth the upgrade? 2 232
Mac OS X 10.7.5 Login Loop 17 91
Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now