Mac OS X Server 1.x: Manually Configuring for IP Routing

This article tells how to configure Mac OS X Server to route IP among several interfaces.
Routing is active when the /etc/routed daemon is running. This daemon is start by the /etc/startup/0800_Network script if the proper settings are made in the /etc/hostconfig file.

When you run the Setup Assistant and configure multiple IP interfaces, it asks for an IP address for a router. You should enter the IP address of your router in this space, but then must manually replace it by editing the /etc/hostconfig file.

After the computer has restarted, open a Terminal window and use vi to edit the /etc/hostconfig file. The file this line:

ROUTER=1.2.3.4

If you have followed the steps above it should be set to point at the IP address of the router you entered in the Setup Assistant. Change the line to look like this:

ROUTER=-ROUTED-

Now when you restart the computer the startup scripts automatically start routed. If you want to change to parameters that are supplied to routed you must edit the /etc/startup/0800_Network script and change the -q parameter in this section:

case ${ROUTER:=-NO-} in

     -ROUTED-)
       # Set the 'q' (quiet) flag by default to avoid broadcasting routes.
       echo "     Using routed"
       routed -q
       ;;

For example if you wanted to have a -s parameter you would change the -q to -s and the final result would look like this:

case ${ROUTER:=-NO-} in

     -ROUTED-)
       # Set the 's' flag to force routed to supply routing information
       echo "     Using routed"
       routed -s
       ;;

A description of the valid parameters to routed and how what they mean is available in the routed man page. Access this page through the Terminal.app with the command 'man routed'.

Published Date: Feb 18, 2012