Firewalls
A firewall is a security measure that controls incoming and outgoing network traffic based on predefined rules and policies. It is typically placed between a protected network and the internet, and its main purpose is to block unauthorized access while allowing authorized communication. Firewalls can be hardware-based or software-based, and they can use a variety of techniques, such as packet filtering, stateful inspection, and application-level filtering, to control network traffic. In this section, we’re going to look into a firewall available on Linux systems.
To control a Linux firewall, you will need to use iptables, ufw, nftables, or firewalld. Packet filtering is built into the Linux kernel, so those CLI tools will interact with it.
iptables
iptables is the most verbose tool for controlling a firewall, meaning it does not have much abstraction built into it, but it’s important to understand the basic concepts so that we can move on to more user...