LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 01-29-2009, 04:59 AM   #1
Actionscript3
LQ Newbie
 
Registered: Jan 2009
Posts: 19

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, 07:13 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,919

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
From the man page

Quote:
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.

HTH
 
Old 01-29-2009, 08:55 AM   #3
r3sistance
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, 09:39 AM   #4
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Yeah, if you use the iptables-save binary you'd need to specify where to send the output. Example:
Code:
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 09:42 AM.
 
Old 01-29-2009, 11:26 AM   #5
Actionscript3
LQ Newbie
 
Registered: Jan 2009
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for all.

I had overlooked the instruction of iptables-save command.
 
  


Reply


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


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

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