Link to home
Start Free TrialLog in
Avatar of jpipitone
jpipitone

asked on

Adding routes at startup in rc.local

This is the contents of my rc.local file that starts tcpserver and qmail:

tcpserver -x/etc/tcp.smtp.cdb -u85 -g81 0 smtp /var/qmail/bin/qmail-smtpd &

I would like to add the following routes at startup to this file - I want to make sure there aren't any syntax errors, can someone help with my syntax?

route add -net 192.168.0.0 255.255.255.0 10.9.3.254
route add -net 10.9.2.0 255.255.255.0 10.9.1.254

Also - do I have to add these values to rc.local or rc.conf?  How would I go about configuring these on rc.conf if that's where they need to go?

How can I add these 2 lines without syntax errors? Can I do a test to check the validity of this file without restarting our FreeBSD machine?

Also, I've seen other people suggest making this change in rc.conf, but I'm not sure what the route_mcast is...

static_routes
                 (str) Set to the list of static routes that are to be added
                 at system boot time.  If not set to ``NO'' then for each
                 whitespace separated element in the value, a route_<element>
                 variable is assumed to exist whose contents will later be
                 passed to a ``route add'' operation.  For example:

                 static_routes="mcast gif0local"
                 route_mcast="-net 224.0.0.0/4 -iface gif0"
                 route_gif0local="-host 169.254.1.1 -iface lo0"
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jpipitone
jpipitone

ASKER

Thank you for the explanation!