LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Routes settings (https://www.linuxquestions.org/questions/slackware-14/routes-settings-721146/)

Murdock1979 04-23-2009 08:21 AM

Routes settings
 
Hello,

I have some customized routing settings. In Slackware, where is the standard place to put them?

Also, when I want a service to run automatically on startup, what the procedure?

Thanks,
Murock

niels.horn 04-23-2009 09:20 AM

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

+Alan Hicks+ 04-23-2009 02:48 PM

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.

Murdock1979 04-23-2009 02:53 PM

Hello!

Thanks, I'll need to track the rc files. Debian and others use a different convention, so it takes a bit getting used to.

I was just wondering my Slackware system does not have an rc.firewall script in /etc/rc.d.

Is it supposed to be installed by default? Where do I get it?

Thanks,
Murdock

niels.horn 04-23-2009 03:00 PM

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.


All times are GMT -5. The time now is 05:51 AM.