A firewall is a network security device that monitors traffic between IP segments or we can say incoming and outgoing network traffic. It decides whether to allow or block specific traffic across trusted (LAN/WAN) & untrusted (internet) zones based on a defined set of security policy rules. A firewall can be hardware, software, or both.