Keep routing table after reboot

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

  1. arveknudsen macrumors newbie

    Jan 7, 2008
    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


    Sep 16, 2007
    This is for Tiger... not sure if it will work in Leopard:
  3. MacsRgr8 macrumors 604


    Sep 8, 2002
    The Netherlands
    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

    Jan 7, 2008
    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


    Mar 30, 2008
    New Jersey, USA
    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 and contains the unix script PersistentRoutes and the .plist file). The link is in his response "here" marked in red.
  6. dimatkach macrumors newbie

    Oct 16, 2008
    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

    Jan 7, 2008

Share This Page