A firewall is a software that acts as a protective barrier between a user’s system and external networks, allowing or blocking packets based on predefined rules. Firewalls operate mainly at the network layer, handling both IPv4 and IPv6 packets.
The decision to allow or block a packet is based on rules defined in the firewall. These rules can be either built-in or user-defined. Each packet that enters or leaves the network must pass through this firewall, where it is evaluated based on these rules.
Linux systems provide multiple firewall management tools, with the most common being Firewalld and UFW. In this article, we will focus on these two tools, explaining their functionality and how to manage them on modern Linux distributions.