I saved my iptable settings on a Ubuntu 11.4 system using

iptables-save >filename

I then replaced the Ubuntu system with CentOS 6.5 and tried to restore iptables using

iptables-restore <filename

This resulted in

iptables-restore v1.4.7: Can't set policy 'INPUT' on 'ACCEPT' line 4: Bad bilt-in chain name

Line 4 is as follows.

:INPUT ACCEPT [199972:10416012]

In the past I have been able to restore iptables fron Ubuntu systems onto Debian systems but Debian is more closely related to Ubuntu than is CentOS. With CentOS, would I just need to add the rules manually?


I did

iptables-save >iptables.original

on my CentOS box and saw that the


line was not present in iptables.original. So I commented out the line from the file I saved on Ubuntu and

iptables-restore <filename

no longer gave any error messages. I subsequently did

iptables-restore --list-rules

and the rules look like the ones that I want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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