-   Linux - Software (
-   -   iptables-save can't save settings (

Actionscript3 01-29-2009 03:59 AM

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.

salasi 01-29-2009 06:13 AM

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.


r3sistance 01-29-2009 07:55 AM

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.

win32sux 01-29-2009 08:39 AM

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).

Actionscript3 01-29-2009 10:26 AM

Thanks for all.

I had overlooked the instruction of iptables-save command.

All times are GMT -5. The time now is 10:57 AM.