Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 used Ubuntu since more than a year now, as the Oneiric Ocelot has more than exceeded my expectations and provides most things out of the box. However, there is one feature that both Windows and Fedora provides - a network firewall that allows us to block specific incoming/outgoing ports such as HTTP(80), FTP(21), etc. I've seen it on Fedora17.

Since I'm going to learn some network programming, such a firewall will be very much useful for my development and testing.

Is there any such equivalent (and reliable) package in Ubuntu repository? I'm aware that I cannot fetch anything from the Fedora repo as they are in RPM formats, and also don't want to mess something with my Ubuntu deb packaging.

share|improve this question
Exact Duplicate:… – stephenmyall Jul 30 '12 at 13:18
Well, not an "exact" duplicate, as I am not too inclined to use the Fedora firewall, but am searching for an Ubuntu alternative instead. – Prahlad Yeri Jul 30 '12 at 13:36
+1 Understood, Just making you aware the question was there incase you found it useful. This line "Or can I install such software from somewhere else?"made me think you consider the fedora FW – stephenmyall Jul 30 '12 at 13:40
ufw (see Rinzwind's answer), gufw (the gui version of UFW, needs GNOME runtime libs), or direct iptables commands are good ones. firestarter is deprecated nowadays since it requires admin privileges to run, regardless of user, so that is dangerous. – Thomas W. Jul 30 '12 at 16:37
It seems that ufw also needs admin privileges to run. What does it make different from firestarter? deprecated maybe... but risky? @Rinzwind said in the accepted answer: "How can you compare that!? A firewall either does what is does or it is not a firewall..." or is it that people MUST use ONLY what is supported by ubuntu? or even worst... what you say? – Geppettvs D'Constanzo Jul 30 '12 at 18:36
up vote 8 down vote accepted

UFW - Uncomplicated Firewall

The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled.

Gufw is a GUI that is available as a frontend.

UFW is installed by default but inactve:

sudo ufw status
Status: inactive


sudo ufw enable


sudo ufw disable


sudo ufw allow /
sudo ufw allow 53
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
sudo ufw deny /
sudo ufw deny 53
sudo ufw deny 53/tcp
sudo ufw deny 53/udp

enter image description here

More info in the 1st link.

share|improve this answer
Thanks Rinzwind. But is ufw as reliable and robust compared to the Fedora firewall which is based on RHEL? In this link:…, the RHEL one seems to have several features such as masquerading, port-forwarding, ICMP filter, etc. whereas ufw just provides allow/deny. – Prahlad Yeri Jul 30 '12 at 13:34
Reliable? Yes, absolutely. Robust as Fedora? How can you compare that!? A firewall either does what is does or it is not a firewall... – Rinzwind Jul 30 '12 at 13:38
They are both based on iptables, just frontends. Just try 'sudo iptables -L' to see exactly (no, there are more, but...) what they do. Yes, it's complicated. That is why there are such tools like ufw. If you tell us more specificly what to do, we could give you other suggestions. – Anders Jul 30 '12 at 17:05
@Anders What I exactly need is a GUI interface like that the windows provides, or one like Fedora/RHEL that I provided in the link. Just want to block incoming/outgoing ports without bothering about underlying iptables, etc. It would be preferable to also block specific programs from accessing certain networks (like Windows fw provides). But yes, presently I think ufw or Gufw can serve my purpose. – Prahlad Yeri Jul 30 '12 at 17:19
yes sir: @PrahladYeri – Rinzwind Jul 30 '12 at 19:55

The default firewall in Ubuntu is ufw - Uncomplicated Firewall. It is a command line tool, designed to be simpler than iptables, the common *nix firewall. A graphical version would be Gufw. You may install that by copying this in a terminal:

sudo apt-get install gufw

Note that ufw is disabled by default. ??! Maybe because only a few people really mess with the firewall rules? If you need more geeky features, you may use Firewall Builder. Not tried it myself, but the interface looks more complex...

sudo apt-get install fwbuilder
share|improve this answer
If you don't run servers, you don't need firewalls. As default desktop Ubuntu doesn't have any network servers running by default, there are no need for a firewall activated. If you don't run a router, I can't see any use of more complicated rules than what ufw (and gufw) gives you. – Anders Aug 11 '12 at 1:38

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.