how to start iptables when system upping?

Matt Hellman mhellman@raccoon.com
Fri, 20 Jul 2001 21:39:43 -0500


All the newer distro's seem to have their own way of loading iptables
scripts.  I haven't investigated them much since it's so easy to load
anyway.  Personally, I just edit /etc/rc.d/rc.local and load my script
from there.  Just add a line like this:

# load firewall script
. /path/to/firewall/script

Using the distro supplied scripts, you will probably be able to load the
firewall earlier in the boot process (rc.local is loaded after all the
other runlevel stuff).  If you wanted to, you could even create your own
init.d script to start the firewall.  Just copy one of the more basic
scripts already in /etc/rc.d/init.d and edit to suit your needs. 
And...to answer your question regarding /etc/rc.d/init.d...the system
does not load those on startup.  Those are there so they can be linked
to from the directories that Linux actually does use during bootup. 
(man chkconfig should tell you what you need to know).

linux_netfilter wrote:
> 
> Hi,all:
>    What I want to do is starting iptables and applying my
> own ruleset.How to do?I am not familiar with linux.Does
> linux run every shell script under /etc/rc.d/init.d?
>    There are both iptables and ipchains under /etc/rc.d/init.d.
> And ipchains and firewall but no iptables are under /etc/sysconfig.
> 
> BTW:I have recompiled the kernel and removed ipchains modules
> and add iptables(and related) modules.Now I can run iptables with
> my own filter rules after system up.But how to do then iptables can
> run with my rules when system upping?
> 
>             linux_netfilter
>             linux_netfilter@sina.com