A firewall is a barrier to keep viruses, worms, and spyware away from your computer. With the use of filters, the firewall examines the information coming through your Internet connection. If any of the information is flagged by the filters as being dangerous to the computer, it is not allowed through. Firewalls are excellent for a first line of defense in protecting your computer from future infections.
BU Linux, which is based on CentOS and RedHat Linux, uses a software firewall product called iptables.
The Linux Home Networking website has an excellent document on How To Configure Linux Firewalls Using iptables.