Re: IPTABLES rules lost at reboot.
From: Martin Cooper (usenet_at_martinc.me.uk)
Date: 05/23/03
- Previous message: Sven Harald Klein Bakke: "Trustix"
- In reply to: Mairhtin O'Feannag: "Re: IPTABLES rules lost at reboot."
- Next in thread: Chris Lowth: "Re: IPTABLES rules lost at reboot."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 22 May 2003 23:28:05 +0100
"Mairhtin O'Feannag" <irishboyca@rocketmail.com> wrote in message
news:Xns9382722E9BDAAmairhtinofeannag@207.115.63.156...
> Martin,
>
> This is really quite an answer. Thanks. The question I have is :
>
> Where does /etc/sysconfig/iptables-script get called? I have my
rules
> there, and it seems that this script just saves and restores the
existing
> rules.
>
> Do I need to run the script and then let this stuff operate
> automatically?
>
> That's fine if that's what I have to do!
>
> Mairhtin
Hi,
this is the standard way of saving / restoring iptables rules
using the system 5 init scripts. Basically, the inittab file
describes where the directories are for the various runlevels. The
program specified is then run for each runlevel. The system then
boots to the default runlevel, which is usually 3 for command line
with networking or 5 for X windows (this varies from one distro to
another as usual, but most use the runlevels that way). Once
started, the scripts in the sysinit runlevel are processed first and
each script beggining with an S is called with the parameter 'start'
being passed into the script. These scripts are called in numerical
order, so are usually numbered 1, 5, 20, 50 etc.
This process is then repeated for the default runlevel specified by
the line 'id:3:initdefault:' where the number is the default runlevel,
in this case 3. When changing runlevels, each script beggining with a
K is called with the parameter 'stop' passed in. Again, these scripts
are called in numerical order. So if you issue the command 'init 5'
from runlevel 3, any scripts in the runlevel 3 directory that begin
with a K will be called in turn, followed by any scripts in the
runlevel 5 directory in order. This is how the system moves between
runlevels.
Runlevel 0 is usually the runlevel used to shutdown and power off the
machine, runlevel 6 is used to reboot the machine without powering
down.
That's basically it. For a full description of the linux boot
process, see
http://www.comptechdoc.org/os/linux/startupman/index.html. Many
distributions come with tools to add and remove scripts in the various
runlevels, and this is usually done by creating a symbolic link in the
appropriate runlevel directory from the script used to dtart that
service which lives in /etc/init.d. Controlling the order of starting
up services is then done just by changing the numbers used in the
names of these scripts.
Martin
- Previous message: Sven Harald Klein Bakke: "Trustix"
- In reply to: Mairhtin O'Feannag: "Re: IPTABLES rules lost at reboot."
- Next in thread: Chris Lowth: "Re: IPTABLES rules lost at reboot."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|