Linux has a default firewall called Ufw(Uncomplicated Firewall) but it has a terminal based interface and you need to be familiar with complex terminal commands in order to perform common firewall operations. Gufw is the front-end powered by Ufw, it offers an easy-to-use graphical interface from where you can decide which ports, ips, services, etc you want to block and allow.
To install it in Ubuntu 9.04, first go to Applications > Add/Remove.
Now, choose Gufw and click Apply Changes.
It will be installed instantly. Now, you can load it from System > Administration > Firewall Configuration.
Now, its very simple to apply rules according to your requirements. There are three tabs Simple, Preconfigured, Advanced. Below is the screenshot showing how can you apply rules using Simple tab. Choose Allow, Deny, or Limit from first drop down menu, enter port number in text box, and choose TCP, UDP, or both from last drop down menu. I have allowed port 21 in firewall and the process is demonstrated in the 2nd screenshot below.
To add the rule in firewall, click Add and it will be visible in the list of applied rule.
From Preconfigured tab you can change some pre-configured option.
Although Simple and Preconfigured tabs are sufficient to perform common firewall operation, but still if you need to add some advanced rule then you can use Advanced tab.
Now, once you are familiar with Gufw, I hope that you will use it often. You can add it in Tray icon from Edit > Preferences and check Show tray icon option.
Click Close and now you will be able to launch it from system tray. Enjoy!