Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm doing a hardware refresh on a my Colo, I just need to copy my UFW rules from my old server to my new server. I dont seem to be able to get them copy all the active rules from my old server to my new one.

How do I copy my active UFW rules between servers?

share|improve this question
I found it in /lib/ufw/user.rules and /lib/ufw/user6.rules. I copy that between server, deactivate and reactive ufw and the rules applied. – Squidly Oct 2 '11 at 2:18
Squidly you can answer and accept your own answer to your question. It may help others who run into a similar problem as they may skip this question if they see it has 0 replies and doesn't have an accepted answer. – 3dinfluence Oct 2 '11 at 2:30
up vote 11 down vote accepted

I found the rules in /lib/ufw/user.rules and for ipv6 you can find the rules in /lib/ufw/user6.rules.

If you copy those files between the servers, disable and then re-enable ufw.

share|improve this answer

Your Answer


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.