A computer-related firewall, whether its composition is hardware or software, has the same basic definition where the term fire refers to a security threat. Firewalls don’t prevent attacks, but mitigate them by only allowing specific ports to be opened to a limited number of hosts inside a network.
Here is a complete tutorial on how to setup Firestarter Firewall in Linux by Ken Hess.