How do I export and restore my iptables settings?

Solution 1:

With suitable privilege

iptables-save > /some/file

will save your iptables configuration to /some/file

and

iptables-restore < /some/file

will restore your saved configuration from /some/file.

Solution 2:

This should do the trick. It writes your rules to /etc/sysconfig/iptables; if you (re)start iptables after you do this, your rules should be there :)

/sbin/service iptables save

Solution 3:

Don't you have iptables-save and iptables-restore commands ?