Indeed a pleasure to see your system secured by sophisticated firewall solution. However, not everyone is ready for a challenge of configuring firewall from command line (or shell).
In this guide, we’ll try to review Gufw frontend for Ubuntu firewall. While there are number of other frontends Gufw, in our opinion, is the easiest to understand, and hence to configure and control the way network security of your computer.
Installation
In case you’re not familiar with process of software installation, please refer to Software installation chapter of our Ubuntu Basics Guide, for detailed graphical guide.
Let’s go:
When Gufw is installed, you may launch it from System > Administration > Firewall configuration.

NOTE: Normally, you should be asked to provide your (administrative) password, but since you’ve been already authorized during Synaptic run, you will not be asked for this the first time.

You’ll see “Firewall” window, which is it – Gufw frontend.
To turn firewall on, check “Enabled” button.

Firewall is now active. If you need it, you can now select default policy for incoming and outgoing packets.
Please refer to Default Policy section of Ufw article, in case you need more information about it.
To add new rule, press “Add” button. In “Add Rule” dialog, you can see three tabs – preconfigured, simple and advanced.

Preconfigured tab features simplified configuration mode, where you can choose filtering port by application or service names.
So, for example, if we want to allow Amule program to accept incoming connection, we should select:

And press “Add”.
Congratulations! Your first firewall rule is created.
Supposedly we want to define port to define manually. For this we’ll need to switch to Simple tab, where we’ll find three lists and a field.

First list contains actions to perform with new network packet your system receives. Available options are:

Second list is switch between two modes:

Third list allows you to select protocol:
Now field is where we should type the port to filter. It can be done in several ways:
NOTE: Total number of ports in list should not be over 15 for compatibility reason. Ranges are counted as two ports (2 items of list).
When you’ve filled all required values, press “Add” to see your rule added to the firewall.

If you need to filter specific IP address or range, you can do so in Advanced tab.
If you noticed, there are two different field sets for IPs and ports – From and To. These are to be used separately, on case-by-case basis.
For example, if you want to disallow inbound traffic from IP address 123.45.67.89, you type this address into From field. Similarly, if you want to deny outgoing connections to that address, you type into To field.
When you’re satisfied with your rule, press “Add” button to apply it.
If you want to remove a rule, locate it in the list of rules and press “Remove” button.


In case you want to reset rules, you can do so by going to Edit > Reset Configuration… .

You will be asked whether you are sure that you want to continue. Press “OK” to remove all the rules.

Gufw also contains preferences, where you can define some additional options. To access preferences, go to Edit > Preferences.

Listening Option
Log Options
To access Gufw actions log, go to File > Log.

Here you can see the list of actions performed by Gufw.

In case you’re planning to use these actions for scripting purpose (eg. for your server), you can check “Show for server script” box. This will remove all verbose information, leaving you with pure ufw commands list.
Add new comment