Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2008, 09:52 AM   #1
Registered: Oct 2007
Location: Plano, TX
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 70

Rep: Reputation: 26
Save iptables rules

I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards
Old 04-15-2008, 10:02 AM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Originally Posted by ochienged View Post
I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards
The generic way:
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:
service iptables save
Old 04-15-2008, 10:07 AM   #3
LQ Newbie
Registered: Apr 2008
Posts: 13

Rep: Reputation: 0
iptables-restore as well is the counter
iptables-restore /somewhere/whateveryousavedas
saved my butt 10 min ago.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables-save, iptables-restore, how to set up them in some script sarajevo Linux - Networking 1 03-24-2008 11:39 PM
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM
how to save iptables firewall rules permanently sunlinux Linux - Security 3 12-07-2006 11:53 AM
iptables-save, but rules don't load on boot-up kpachopoulos Debian 2 11-18-2006 10:36 PM
iptables save rules Osten Debian 1 02-10-2004 04:53 PM

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration