siliconpi Asked: 2010-09-23 02:55:30 +0800 CST2010-09-23 02:55:30 +0800 CST 2010-09-23 02:55:30 +0800 CST How do I export and restore my iptables settings? 772 I have what appears to be weird and convoluted set of rules which work for me at the moment. Is there a way of "exporting" those and saving them to a file so that they can be restored later on in case things are messed up? linux redhat iptables 3 Answers Voted Best Answer user9517 2010-09-23T03:03:14+08:002010-09-23T03:03:14+08:00 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. wzzrd 2010-09-23T03:02:19+08:002010-09-23T03:02:19+08:00 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 ixio 2010-09-23T02:57:44+08:002010-09-23T02:57:44+08:00 Don't you have iptables-save and iptables-restore commands ?
With suitable privilege
will save your iptables configuration to /some/file
and
will restore your saved configuration from
/some/file
.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 :)
Don't you have
iptables-save
andiptables-restore
commands ?