UFW (Uncomplicated firewall) For Ubuntu Hardy
Posted by admin on February 7th, 2008
Email This Post
Install UFW in Ubuntu
Currently this firewall package is available in Ubuntu 8.04
sudo apt-get install ufw
This will complete the installation
Turn firewall on and off (’disable’ is default ACCEPT)
# ufw enable|disable
Toggle logging
# ufw logging on|off
Set the default policy (ie “mostly open” vs “mostly closed”)
# ufw default allow|deny
Accept or drop incoming packets to (can see what services are available with ’status’ (see below)). can be specified via service name in /etc/services, ‘protocol:port’, or via package meta-data. ‘allow’ adds service entry to /etc/ufw/maps and ‘deny’ removes service entry from /etc/ufw/maps. Basic syntax:
# ufw allow|deny [service]
Display status of firewall and ports in the listening state, referencing /var/lib/ufw/maps. Numbers in parenthesis are not displayed to user
# ufw status
UFW Examples
Allow port 53
$ sudo ufw allow 53
Delete Allow port 53
$ sudo ufw delete allow 53
Allow port 80
$ sudo ufw allow 80/tcp
Delete Allow port 80
$ sudo ufw delete allow 80/tcp
Allow port smtp
$ sudo ufw allow smtp
Delete Allow port smtp
$ sudo ufw delete allow smtp
Allow fro Particular IP
$ sudo ufw allow from 192.168.254.254
Delete the above rule
$ sudo ufw delete allow from 192.168.254.254
If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!


March 31st, 2008 at 12:05 pm
Any chnace there will be a GUI for UFW in Hardy Heron, I just rely on IPTABLES and FireStarter to control my network traffic.
Is UFW any better than FireStarter and IPTABLES…??
April 3rd, 2008 at 2:10 am
Why would I want to use this when I can use firestarter? It’s powerful and easy.
April 6th, 2008 at 1:08 pm
Darren - There’s a GUFW project, but I doubt it’ll be done by Hardy, or even a default in Intrepid.
April 6th, 2008 at 1:11 pm
Dan - Apparently, UFW is easier. :eyeroll:
I saw somewhere on the ubuntu forums that firestarter was kinda intermediate, whereas ufw you just turn on and occasionally open or close a port when you feel like it.
April 27th, 2008 at 9:41 pm
Why use this when you can use Firestarter? Because I hope you don’t run a GUI+Firestarter on your servers. Firestarter is great for a desktop, ufw makes things simpler on a server.
May 3rd, 2008 at 1:03 pm
How can we open a port range using Ubuntu’s 8.04 ufw?
May 5th, 2008 at 11:03 pm
very, very simple article
Please more explain.
May 7th, 2008 at 1:06 pm
No aparecen por ninguna parte las ventajas de ufw sobre los demas firewalls. ¿Ufw puede filtrar la salida a internet o bloquearla?
May 7th, 2008 at 6:34 pm
english
May 8th, 2008 at 5:43 am
He said: “Nowhere does it say the advantages that ufw has over other firewalls. ufw can filter connections to the internet, or block it?”
May 8th, 2008 at 3:55 pm
I said: does not appear anywhere on the advantages of UFW on the other firewalls. UFW can block and filter out the Internet?
May 9th, 2008 at 5:41 pm
Very handy for those of us not familiar enough to configure IP tables directly. Thanks! This was just what I needed for securing my server quickly.
May 12th, 2008 at 1:50 pm
I have started using UFW and it works fine and is relatively easy. Is there a way to allow multiple ports from a command such as sudo ufw allow 28000-29100? Instead of putting in all of those ports?
I initially put in sudo ufw deny all and then started going back and putting in the ports I needed opened. Any help would be great.
May 13th, 2008 at 6:48 pm
Does UFW allow the filtering of the hosts allowed to connect to the open port? I’d like to only allow certain hosts to connect to the port.
May 15th, 2008 at 3:09 am
Does any one have a more complete article on how to use UFW? There are a lot of /etc files that I have not seen explained anywhere. How can you setup basic NATing for my network?