

It is important to note that any rules applied with the iptables command are not persistent through a reboot. The command can be handy if we need to troubleshoot a firewall, and it can be reversed with iptables -P INPUT DROP.

We can change the default policy with the command iptables -P INPUT ACCEPT, which will allow any traffic even if it is not defined in the INPUT table. The INPUT table also has a default policy of DROP that defines what to do with the traffic if no rule matches. In this example, the INPUT table has several rules configured. ACCEPT tcp - anywhere anywhere tcp dpt:sshĪCCEPT tcp - anywhere anywhere tcp dpt:smtpĪCCEPT icmp - anywhere anywhere icmp echo-request
