LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Save iptables rules (http://www.linuxquestions.org/questions/linux-newbie-8/save-iptables-rules-635494/)

ochienged 04-15-2008 09:52 AM

Save iptables rules
 
I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards

win32sux 04-15-2008 10:02 AM

Quote:

Originally Posted by ochienged (Post 3121927)
I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards

The generic way:
Code:

iptables-save > /somewhere/example.txt
As you can see, you can save the config to any text file you want, but you should probably find-out which file your distro is configured to automatically restore them from at boot time and then save to that. Usually it's something like /etc/sysconfig/iptables or similar.

The Red Hat-based distro way:
Code:

service iptables save

Curtix 04-15-2008 10:07 AM

iptables-restore as well is the counter
Code:

iptables-restore /somewhere/whateveryousavedas
saved my butt 10 min ago.


All times are GMT -5. The time now is 11:09 AM.