One of the essential steps required to secure a Linux system is to set up a good firewall. Most Linux distributions come preinstalled with different firewall tools. Iptables is one such default firewall in a Linux distribution. In older versions of the Linux kernel, Ipchains was the default firewall.
Since Iptables ships with the Linux distribution, no extra tool needs to be installed to use it. However, it is recommended that when you use Iptables; do not use the root account. Instead, use a normal account that has super-user access to run the commands efficiently.
We can define different rules using Iptables. These rules are then followed by the kernel when checking incoming and outgoing traffic packets: