RHEL 6 Iptables-Save
Posted on 2011-10-03
Hello everyone. I am somewhat new to administering Red Hat so please bear with me.
Here are the kernels I'm running-
Old RHEL 2.6.9-5.EL
New RHEL 2.6.32-131.6.1.el6.x86_64
I am in the process of replacing an our old RHEL server, and I need to migrate the iptables to the new server (I want the same exact setup). I tried saving a copy of iptables on the old server-
cd/etc/sysconfig/cp iptables iptables.bak1
And then I tried using the iptables-restore command on the new server, only to get "iptables-restore line 5 failed".
Is this because I'm not using the iptables-save command and just making a copy of the file? Can I run iptables-save without it affecting or messing anything up as this is our main router? OR is there no difference between doing a cp iptables and iptables-restore and I'm looking at a bigger problem here?
I'm open to any suggestions if someone has a better way to migrate iptables to a new machine.