SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
One simple solution is to put the "route add ...." commands in /etc/rc.d/rc.local
The same goes for starting a service at boot time.
If it is an existing service (say like ntpd), there will be a /etc/rc.d/rc.ntpd that you should just make executable with
Code:
chmod +x /etc/rc.d/rc.ntpd
If it is a service you installed yourself, put the command to start it in /etc/rc.d/rc.local
Probably the best place to put all this is in /etc/rc.d/rc.local; however, if some of your network services require these routes to be present when they are activated, things could get out of sync. This usually isn't a problem with self-installed services called from rc.local, because you can add the route statements to rc.local before calling those services. If for some reason, you have to have these services running before one or more of the services included with Slackware starts, you'll need to add the route earlier. Perhaps the best place is in rc.firewall. You can add those rules there just before calling your custom firewall (if one exists on the machine) and they'll be present before any network services are started.
The rc.firewall script does not come with the default installation, but if it exists and is executable, it will be run by rc.inet2:
Code:
# If there is a firewall script, run it before enabling packet forwarding.
# See the HOWTOs on http://www.netfilter.org/ for documentation on
# setting up a firewall or NAT on Linux. In some cases this might need to
# be moved past the section below dealing with IP packet forwarding.
if [ -x /etc/rc.d/rc.firewall ]; then
/etc/rc.d/rc.firewall start
fi
Alien Bob has a nice script to create a basic firewall to start with here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.