Jump to content

Add STATIC ROUTE


xkostas
 Share

6 posts in this topic

Recommended Posts

I want to ask , how can i add a static route to my 10.4.7 system ?

 

I give in a terminal "route add 192.0.0.0 192.168.0.1" and it works. It add's a gateway to my stantard configuration i have in the System Prefference, but when i reboot the route has gone.

 

Is there a parameter like the "route add -p" of Windows ?

Link to comment
Share on other sites

Until you solve the problem, one way might be to create an Applescript to set the route command at every boot, and set that to run at boot.

 

Go to your Applications -> AppleScript folder and double-click on "Script Editor"

 

Copy and paste the following script into Script Editor

 

do shell script "route add 192.0.0.0 192.168.0.1"

 

Press "Compile" to verify the code.

 

Save the script as an application as follows:

1) Go to File menu and select "Save As..."

2) Give your application a name (like RTE)

3) Select a place to put it (I recommend the Applications folder)

4) Select File format: application bundle *

5) Check the "Run Only" button

6) UN-Check the "Startup Screen" button

7) Press "Save"

8) Quit Script Editor

 

(* Seems that saving it as an application gives it a PPC wrapper that requires Rosetta. Saving it as a bundle gives it an Intel wrapper, so start-up time should be faster as a bundle, even though it doesn't actually have to be a bundle.)

Go to where you saved the application and double-click it to verify that it runs correctly.

 

If it works, set it as a start-up item:

- Go to System Preferences -> Accounts

- Click on the Login Items tab

- Click the plus (+) button

- Find the application and press the Add button

Reboot to verify that the start-up item works

Link to comment
Share on other sites

  • 1 year later...

OSX is Unix based at its core. I think OS9 migrants sometimes forget this fact.

 

Just add a line to /etc/rc.local and you're done. No screwing around with long-winded instructions with /Library/StartUpItems, etc etc.

 

IE:

 

root# cat /etc/rc.local

route add -net 172.22.0.0 127.0.0.1

 

Give that a try, should work fine.

 

-Glenn

Link to comment
Share on other sites

 Share

×
×
  • Create New...