Adding routes at startup in rc.local

Posted on 2006-05-12
Last Modified: 2013-11-22
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
route add -net

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...

                 (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 -iface gif0"
                 route_gif0local="-host -iface lo0"
Question by:jpipitone
    LVL 61

    Accepted Solution

    route_mcast is string.

    hope this explains a lot:
    static_routes="intranet dmz"

    rc.local should be avoided - rc.conf covers almost everything.
    LVL 1

    Author Comment

    Thank you for the explanation!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now