Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I configured a Debian Squeeze virtual machine in VMWare on my laptop. I configured it with a very restrictive set of firewall rules using Firestarter. I then uploaded a copy of its disk image to use as a virtual private server on the internet.

On the internet version, I rather rashly removed my firewall settings via the following command:

apt-get purge firestarter

I’ve since realised I want to restore the firewall rules to their old state, which is still on the original virtual machine on my laptop.

My question is: how can I copy the firewall settings from the virtual machine on my laptop to the one on the internet?

I tried copying /sbin/iptables from the original virtual machine to the new one, but that hasn’t had any effect (according to the output of iptables -L).

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You can use iptables-save and iptables-restore, or you can once more install firestarter and use the config file from the old machine.

share|improve this answer
    
Ah, okay — I guess I could just copy everything from /etc/firestarter on the old machine to the new one. I’ll give that a try. –  Paul D. Waite Dec 21 '11 at 19:55
    
I think copying all the firestarter config files appears to have borked my firewall somehow, as I can no longer communicate with the server! However, iptables-save and iptables-restore looked like they would have worked great, so I’ll be sure to use them next time. –  Paul D. Waite Dec 22 '11 at 23:57
    
Have this server the same IP address? If not, this can be a reason... –  Jan Marek Dec 23 '11 at 5:02
    
Ah! No, it doesn’t — I can imagine how that could have caused some issues. –  Paul D. Waite Dec 23 '11 at 16:37
    
Can you provide details on using iptables-save and iptables-restore when the server ip addresses differ? Is anything special required, or will simply loading the rules on the new server work? –  MountainX Jun 21 '12 at 20:24
show 1 more comment

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.