Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-29-2009, 03:59 AM   #1
LQ Newbie
Registered: Jan 2009
Posts: 20

Rep: Reputation: 0
iptables-save can't save settings

Hi, I am new here,

Config a CentOS iptables.

I issued some iptables rules.
the rules were effective at once.
Then, I came with a "iptables-save", but the "/etc/sysconfig/iptables" file hasn't been updated, it still loads the defaults rules with CentOS after reboot.

I tried a new installation on VMware, but it's the same.

Thanks for help.
Old 01-29-2009, 06:13 AM   #2
Senior Member
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,049

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
From the man page

iptables-save is used to dump the contents of an IP Table in easily parseable format to STDOUT. Use I/O-redirection provided by your shell to write to a file.
I think that describes the problem and suggests the answer.

Old 01-29-2009, 07:55 AM   #3
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
iptables-save? never seen or used it like that, I generally use "/etc/init.d/iptables save" alternatively as root "service iptables save". Remember you need root permissions for iptables to be able to write to it's on configuration file.
Old 01-29-2009, 08:39 AM   #4
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Yeah, if you use the iptables-save binary you'd need to specify where to send the output. Example:
iptables-save > /etc/sysconfig/iptables
The "service iptables save" mentioned by r3sistance seems like the most popular method to me (for Red Hat-based distros), though. BTW, I'm moving this to Software, as it's not a security issue (at least not directly).

Last edited by win32sux; 01-29-2009 at 08:42 AM.
Old 01-29-2009, 10:26 AM   #5
LQ Newbie
Registered: Jan 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for all.

I had overlooked the instruction of iptables-save command.


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
settings won't save miner49er Debian 1 04-01-2006 12:27 PM
kwifimanager doesn't save settings fizgig10 Linux - Wireless Networking 1 11-29-2004 10:58 PM
How do I save my settings? laverscheval DamnSmallLinux 2 10-08-2004 08:44 PM
Save mixer settings corwax Linux - General 4 12-18-2003 01:59 PM
How to save Settings in Konqueror? albean Linux - Newbie 1 10-06-2002 07:18 PM

All times are GMT -5. The time now is 02:40 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