LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 03:59 AM   #1
Actionscript3
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
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
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, 07:55 AM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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 08:42 AM.
 
Old 01-29-2009, 10:26 AM   #5
Actionscript3
LQ Newbie
 
Registered: Jan 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for all.

I had overlooked the instruction of iptables-save command.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:01 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
Open Source Consulting | Domain Registration