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've recently upgrade my Ubuntu server install to 9.04. I'd like to install and use ufw. Is there a way to import my existing iptables into ufw? I'm worried about switching it on, and having all my ports closed. I'd like to open up a single additional tcp port, but don't want to go through the complicated process of changing my iptable rules.

share|improve this question
up vote 1 down vote accepted

Manually put your old rules in "/etc/ufw/before.rules" or "after.rules". These are in standard iptables format. There is also var/lib/user.rules, but these are overwritten by adding rules via ufw. Put your existing rules in place, add your new rules via ufw allow, and enable ufw afterwards.

share|improve this answer
I haven't configured iptables in over a year, so I don't want to relearn the process just to open a tcp port. This is exactly what I need to get going with ufw. – brianegge Aug 31 '09 at 23:28

ufw is an intuitive frontend to iptables for newbies.

If you already grok iptables, I see no reason why you should switch.

share|improve this answer

i guess you can keep your iptables rules and do something like this:

  1. open a screen window
  2. sudo ufw enable && sleep 120 && sudo ufw disable (be sure it wont ask you passwd :D)
  3. do you testing and in a worst case scenario wait 120 secs

With this method you can test certain rules, without having an issue when you have to go to the co-loc.

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.