Difference between revisions of "Leopard Static Routes"

From Secure Computing Wiki
Jump to: navigation, search
(StartupParameters.plist)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://icucoja.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://icucoja.co.cc CLICK HERE]=
 +
----
 +
</div>
 
I found a little how-to over at [http://www.osxfaq.com OSXFAQ] on how to do a proper static route on OS X Leopard, which will persist through reboots.  Please, go over [http://www.osxfaq.com/tips/kluskens/index.ws there] and read it, if you'd like.  I've got a couple minor changes to make it a bit clearer as to what it does:
 
I found a little how-to over at [http://www.osxfaq.com OSXFAQ] on how to do a proper static route on OS X Leopard, which will persist through reboots.  Please, go over [http://www.osxfaq.com/tips/kluskens/index.ws there] and read it, if you'd like.  I've got a couple minor changes to make it a bit clearer as to what it does:
  
Line 6: Line 14:
  
 
To avoid having to do this everytime you reboot your system, we need to build a custom startup script.  The Apple/OS X way to do this, is to put a script in /System/Library/StartupItems.  Let's build the framework first:
 
To avoid having to do this everytime you reboot your system, we need to build a custom startup script.  The Apple/OS X way to do this, is to put a script in /System/Library/StartupItems.  Let's build the framework first:
<pre># cd /System/Library/StartupItems
+
&lt;pre># cd /System/Library/StartupItems
 
# sudo mkdir StaticRoutes
 
# sudo mkdir StaticRoutes
 
# sudo chmod 0755 ./StaticRoutes
 
# sudo chmod 0755 ./StaticRoutes
 
# cd StaticRoutes
 
# cd StaticRoutes
# touch StaticRoutes && touch StartupParameters.plist
+
# touch StaticRoutes &amp;&amp; touch StartupParameters.plist
# chmod 0644 ./* && chmod o+x StaticRoutes
+
# chmod 0644 ./* &amp;&amp; chmod o+x StaticRoutes
</pre>
+
&lt;/pre>
  
 
This gets you a directory called StaticRoutes, which contains two files, StaticRoutes and StartupParameters.plist.  We've also configured the proper permissions on these files.
 
This gets you a directory called StaticRoutes, which contains two files, StaticRoutes and StartupParameters.plist.  We've also configured the proper permissions on these files.
Line 18: Line 26:
 
Fill these two new files with the following text, respectively.
 
Fill these two new files with the following text, respectively.
 
===StaticRoutes===
 
===StaticRoutes===
<pre>#!/bin/sh
+
&lt;pre>#!/bin/sh
  
 
##
 
##
Line 31: Line 39:
  
 
## Enter static routes here, one line at a time as follows:
 
## Enter static routes here, one line at a time as follows:
# route add <destination_network> <next_hop>  (man route for syntax)
+
# route add &lt;destination_network> &lt;next_hop>  (man route for syntax)
  
 
}
 
}
Line 45: Line 53:
 
}
 
}
  
RunService "$1"</pre>
+
RunService "$1"&lt;/pre>
  
 
===StartupParameters.plist===
 
===StartupParameters.plist===
<pre>{
+
&lt;pre>{
 
Description = "Static Routes";
 
Description = "Static Routes";
 
Provides = ("StaticRoutes");
 
Provides = ("StaticRoutes");
 
Requires = ("Network");
 
Requires = ("Network");
 
OrderPreference = "None";
 
OrderPreference = "None";
}</pre>
+
}&lt;/pre>
  
 
[[Category: Mac OS X]]  
 
[[Category: Mac OS X]]  
 
[[Category: Leopard]]
 
[[Category: Leopard]]

Revision as of 17:48, 23 November 2010



This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page


CLICK HERE


I found a little how-to over at OSXFAQ on how to do a proper static route on OS X Leopard, which will persist through reboots. Please, go over there and read it, if you'd like. I've got a couple minor changes to make it a bit clearer as to what it does:

To add a static route you need to issue a command like:

sudo route -nv add -net 192.168/16 -interface en0

To avoid having to do this everytime you reboot your system, we need to build a custom startup script. The Apple/OS X way to do this, is to put a script in /System/Library/StartupItems. Let's build the framework first: <pre># cd /System/Library/StartupItems

  1. sudo mkdir StaticRoutes
  2. sudo chmod 0755 ./StaticRoutes
  3. cd StaticRoutes
  4. touch StaticRoutes && touch StartupParameters.plist
  5. chmod 0644 ./* && chmod o+x StaticRoutes

</pre>

This gets you a directory called StaticRoutes, which contains two files, StaticRoutes and StartupParameters.plist. We've also configured the proper permissions on these files.

Fill these two new files with the following text, respectively.

StaticRoutes

<pre>#!/bin/sh

  1. Load local static routes

. /etc/rc.common

StartService () { ConsoleMessage "Loading Static Routes"

    1. Enter static routes here, one line at a time as follows:
  1. route add <destination_network> <next_hop> (man route for syntax)

}

StopService () { return 0 }

RestartService () { return 0 }

RunService "$1"</pre>

StartupParameters.plist

<pre>{ Description = "Static Routes"; Provides = ("StaticRoutes"); Requires = ("Network"); OrderPreference = "None"; }</pre>