Keep routing table after reboot

Discussion in 'macOS' started by arveknudsen, May 14, 2008.

  1. arveknudsen macrumors newbie

    Joined:
    Jan 7, 2008
    #1
    How do you save changes when you make manual changes to OSX’s routing tables?
    I have been adding neccesary network routes (with the terminal command line) and changing the default gateways, but whenever the machine is rebooted it loses all this info...
    Any ideas?
     
  2. thirdeyeopen666 macrumors 6502

    thirdeyeopen666

    Joined:
    Sep 16, 2007
    #2
    This is for Tiger... not sure if it will work in Leopard:

    http://www.webboise.com/persistent-ip-routes-in-mac-os-x-tiger/
     
  3. MacsRgr8 macrumors 604

    MacsRgr8

    Joined:
    Sep 8, 2002
    Location:
    The Netherlands
    #3
    You mean the "route add -net.."?

    You know, I have run into this some time ago. I think the quickest way I fixed it was to put it into a script and made it a launch item...

    EDIT: similar to the post above.. :-/
     
  4. arveknudsen thread starter macrumors newbie

    Joined:
    Jan 7, 2008
    #4
    But then the user need to type the root password when the script execute. I can not give the root password to the users.
     
  5. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #5
    It should work in Leopard as well since this is core Unix stuff.

    Also, on that same web page is another link (under Responses, from Rick - the second one down) to download an archive with the two example files (archive is called PersistentRoutes.zip and contains the unix script PersistentRoutes and the .plist file). The link is in his response "here" marked in red.
     
  6. dimatkach macrumors newbie

    Joined:
    Oct 16, 2008
    #6
    Just put this into /etc/rc.local:

    /sbin/route add -net <network> <gateway>

    It will run as root on startup, no need for the user to enter password
     
  7. arveknudsen thread starter macrumors newbie

    Joined:
    Jan 7, 2008

Share This Page