LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo (http://www.linuxquestions.org/questions/linux-general-1/my-iptables-script-is-etc-sysconfig-iptables-how-do-i-make-this-baby-execute-on-boo-12043/)

ForumKid 01-18-2002 09:23 AM

My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo
 
I want to make it execute on boot. Is there a certain way that i should be doing it? I need to make sure that it executes everytime the server is restarted?

Im not sure if i should just put the script inside rc.local.
Thanks

JimKyle 01-18-2002 09:41 AM

Check to make certain that iptables really is a script, not a data file created by iptables-save. In my Mandrake 8.1 system, it's a data file, and I added to rc.local the line "/sbin/iptables-restore" in order to re-create the rules at boot. I also created a daily cron job for root, to do "/sbin/iptables-save" each night, so that any rules added by portsentry during the day would be saved...

Check out your actual initialization scripts to see for certain that the "start" and "stop" actions for iptables use the /etc/sysconfig/iptables data or script... I suspect, though, that most recent distributions will be rather similar to what I have here.

bluecadet 01-18-2002 09:41 AM

yeah, just link it there. that's normal.

phil1076 01-22-2002 07:36 AM

go into your script directory and make the script executable. (chmod 755 scriptname)

go into /etc/rc.d/rc3.d and create a symlink to the script. Call the link Sxxfirewall, where xx is a number that corresponds to which order you want it to execute it. eg: S90dhcp will run before S92firewall.


All times are GMT -5. The time now is 05:30 PM.