$linuxjunkies
>

firewall

also: packet filter, iptables, firewalld, ufw

A firewall is a system or software tool that monitors and controls incoming and outgoing network traffic based on predetermined security rules, acting as a barrier between trusted and untrusted networks.

A firewall examines network packets and decides whether to allow or block them based on rules you define. It can operate at the network level (hardware firewalls protecting entire networks) or on individual systems (software firewalls like ufw or firewalld on Linux).

Linux firewalls typically use iptables, nftables, or higher-level managers like ufw to filter traffic. Rules specify which ports, protocols, and IP addresses are permitted. For example, you might allow incoming traffic on port 22 (SSH) from your office IP but block it everywhere else.

Common use cases include: blocking unauthorized access to services, restricting outbound connections to prevent malware communication, implementing network segmentation, and rate-limiting traffic. Most production Linux servers run a firewall to restrict access to only necessary services.

Related terms