Re: IPTABLES rules lost at reboot.

From: Martin Cooper (usenet_at_martinc.me.uk)
Date: 05/23/03

  • Next message: Whoever: "Re: POP3, SSL, Outlook Express and certificates"
    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


  • Next message: Whoever: "Re: POP3, SSL, Outlook Express and certificates"

    Relevant Pages

    • Re: how do I configure a USB device?
      ... This is what made me think that I only have to run a script to call rcirda ... to /etc/init.d/irda This is the runlevel startscript I mentioned. ... Insserv generates these runlevel scripts by creating symbolic links in the ... as network ...
      (alt.os.linux.suse)
    • Re: Files in the /rtc/rc.d/rc*.d directory
      ... And when the systems shuts down are the scripts in this ... K* scripts are called when you leave the runlevel. ... or shutdown scripts are called: e.g. you want the network up before ... When you boot the machine, you enter the runlevel specified by the ...
      (comp.os.linux.misc)
    • Re: Files in the /rtc/rc.d/rc*.d directory
      ... And when the systems shuts down are the scripts in this ... >> and another ones with S, are ones called during the boot and the ... >K* scripts are called when you leave the runlevel. ... # Check if the subsystem is already up. ...
      (comp.os.linux.misc)
    • RE: Changing run levels -init.d
      ... > What I want to know at what runlevels the start and kill scripts are ... > It looks at the K scripts in runlevel 5 executes them and then looks ... > It doesn’t execute anything in runlevel 3. ... unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe ...
      (RedHat)
    • RE: Changing run levels -init.d
      ... I DO NOT want the db startup and shutdown to be managed in ckhconfig. ... If I am at runlevel 3 and going to runlevel 5 ... It looks at the K scripts in runlevel 5 executes them and then looks at the S ...
      (RedHat)

  • Quantcast