PDA

View Full Version : Persistant Static routes ?



rockinrobstar
10th August 2004, 11:57 AM
Hey all,

Im just wondering if anyone knows how to add static routes (that are persistant) in Mac OS X (Darwin). I want to add routes to my city wireless network (Air-Stream (http://www.air-stream.org) in Adelaide for those interested) on 10.0.0.0/8 which gets passed to my wireless router 192.168.1.2. All other traffic (default route) is for the internet gets passed to my adsl router at 192.168.1.1 and my computer is on 192.168.1.3/24.

I can add the route through terminal:

[Talietha:~] robin% su
Password:
[Talietha:~] root# route add -net 10.0.0.0 192.168.1.1 255.0.0.0
add net 10.0.0.0: gateway 192.168.1.1

but as soon as I restart this route disappers (note if you want to look at the routes on Mac OS X you can use "netstat -r" ; this is the same as "route" on linux or "route print" on MS-DOS).

How do i make the route persistant? Looking up the opendarwin docs - they just refer you to the freebsd docs which tell you to add something to the rc.conf file - only problem is darwin doesn't have an /etc/rc.conf file - and the rc files that are there seem to be all scripts (not a real elegent place to add random commands). I figured since its a fairly basic thing that you would want to do with routing that there would be somewhere 'proper' to put the route - but I haven't had much luck in finding that place. Any help would be appreciated.

Thanks,

Rob

p.s. if anything needs further explaing tell me what you don't understand.

mbd
10th August 2004, 01:36 PM
I haven't tested it but this site gives some instructions on how to do it;

http://www.osxfaq.com/tips/kluskens/index.ws