Hardware or software?
A firewall is merely a set of rules setting waht traffic is allowed in and out, preferably backed up by a more intelligent system, an Intrusion Detection System such as Snort or Tripwire (or Zonealarm under windows, blackice doesn't count, except as a bad joke).
Hardware firewalls are just dedicated hardware.