Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got a new VPS with a new company and all that.

Anyway when I try to edit /etc/sysconfig/iptables the file is empty!

What should I do? I want to import my old iptable settings to open some ports...

I am running centOS 6...I will be going from 5.7

Also my old server was a dedicated server if that makes any difference.

Any ideas?

I installed CentOS 5.6 and iptables didn't even exist...the config did but not the file iptables...so I created it and it seems to be working fine when I do iptables -L

but I try to do a restart so they'll take affect and I get this error

Flushing firewall rules: [ OK ] Setting chains to policy ACCEPT: security raw nat mangle fi[FAILED] Unloading iptables modules: [ OK ] Applying iptables firewall rules: [ OK ]

Has anyone else ever had this issue, how should I go about fixing it?

share|improve this question

1 Answer 1

You can use:

iptables-save > rules.txt

to dump the rules to a text file.

Then, you can use:

iptables-restore rules.txt

to activate these rules.

share|improve this answer
    
Ok I did that but when I try restarting iptables I get this iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter –  Josip Gòdly Zirdum Feb 18 '12 at 12:15
    
How did you restart iptables? Did you overwrite the empty file /etc/sysconfig/iptables? –  Khaled Feb 18 '12 at 12:17
    
service iptables restart is what I did. But it seems "iptables-restore rules.txt" did nothing. Should I just copy paste them in... One thing I did notice is the iptables file doesn't even exist, it wants to make one. –  Josip Gòdly Zirdum Feb 18 '12 at 12:20
    
@JosipGòdlyZirdum: Yes, you need to create one and fill it with your rules. Then, service iptables restart. –  Khaled Feb 18 '12 at 12:38
    
I did it and it seems ok but when I try restarting it I get this "Setting chains to policy ACCEPT: security raw nat mangle fi[FAILED]" –  Josip Gòdly Zirdum Feb 18 '12 at 14:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.