Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Edgy,Feisty,Gutsy,Hardy

  • Subscribe RSS Feed

    subscribe to the ubuntu Geek RSS feed




  • Sponsor

  • Categories

  • Meta

  • Sponsor

  • Archives



  • WidgetBucks - Trend Watch - WidgetBucks.com

UFW (Uncomplicated firewall) For Ubuntu Hardy

Posted by admin on February 7th, 2008 Email This Post Email This Post

Create a tool for host-based iptables firewall configuration. This tool should provide an easy to use interface to the user, as well as support package integration and dynamic-detection of open ports.

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!

Related Articles

15 Responses to “UFW (Uncomplicated firewall) For Ubuntu Hardy”

  1. Darren Says:

    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…??

  2. Dan Says:

    Why would I want to use this when I can use firestarter? It’s powerful and easy.

  3. Captain Nemo Says:

    Darren - There’s a GUFW project, but I doubt it’ll be done by Hardy, or even a default in Intrepid.

  4. Captain Nemo Says:

    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.

  5. Christer Edwards Says:

    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.

  6. cviorel Says:

    How can we open a port range using Ubuntu’s 8.04 ufw?

  7. m4r10l4 Says:

    very, very simple article :( Please more explain.

  8. jaime Says:

    No aparecen por ninguna parte las ventajas de ufw sobre los demas firewalls. ¿Ufw puede filtrar la salida a internet o bloquearla?

  9. karl Says:

    english

  10. Yözen Says:

    He said: “Nowhere does it say the advantages that ufw has over other firewalls. ufw can filter connections to the internet, or block it?”

  11. jaime Says:

    I said: does not appear anywhere on the advantages of UFW on the other firewalls. UFW can block and filter out the Internet?

  12. scotru Says:

    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.

  13. Kyle Says:

    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.

  14. Chuck Says:

    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.

  15. Casey Says:

    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?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>