?
Solved

Adding routes at startup in rc.local

Posted on 2006-05-12
2
Medium Priority
?
1,013 Views
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 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"
0
Comment
Question by:jpipitone
2 Comments
 
LVL 62

Accepted Solution

by:
gheist earned 2000 total points
ID: 16677050
route_mcast is string.

hope this explains a lot:
static_routes="intranet dmz"
route_intranet="-net 192.168.0.0/24 10.9.3.254"
route_dmz="-net 10.9.2.0/24 10.9.1.254"

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

Author Comment

by:jpipitone
ID: 16683723
Thank you for the explanation!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 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