-   Red Hat (
-   -   how to save iptables (

ricnoah 02-15-2006 09:30 PM

how to save iptables
i am learning how to configure the firewall in RH9 using the konsole,but it's so funny i do not know the command how to save the alteration i had made, what is the command to save the alteration, like ctrl s in windows

thank you.

gilead 02-15-2006 09:40 PM

You can use iptables-save to dump out the contents of your firewall and redirect it to a file:

iptables-save > firewall.log
You can then retrieve it with:

iptables-restore < firewall.log
I tend to build the rules in a script and start it at boot time, rather than use the above method. It just depends which suits the way you're working...

whencat 02-16-2006 05:05 AM

service iptables save
I think the above also is a valid choice.

doublejoon 02-16-2006 06:35 AM


Originally Posted by whencat
service iptables save
I think the above also is a valid choice.

or /etc/init.d/iptables save will work also

43r05p4c3 02-16-2006 07:44 PM

Which (if any) of these commands will enable the saved options on boot?

If none (warning newbish question follows), where/how do I save a script to run on boot?



ricnoah 02-16-2006 08:42 PM


thanks a lot you gave me an idea

gilead 02-16-2006 08:50 PM

Glad to hear it - it's Friday afternoon here and I'm fresh out of ideas for this week :)

ricnoah 02-19-2006 07:32 PM

can anyone who can tell me how to start iptables everytime i boot my pc?

gilead 02-19-2006 10:48 PM

In /etc/init.d is the a file called iptables or rc.iptables? It needs to be executable and modified to start up your iptables rules. If there isn't a file call that, you can add the commands to /etc/init.d/rc.local.

All times are GMT -5. The time now is 08:44 PM.