A network firewall is a security device or software that controls and monitors network traffic based on predefined rules, acting as a barrier between a trusted internal network and untrusted external networks like the internet. It essentially acts as a gatekeeper, allowing or blocking traffic based on these rules, protecting the network from unauthorized access and potential threats.