@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1. Installation of Iptables @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ $ sudo apt install iptables-persistent ####To view/list the rules## $ sudo iptables -L -v @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2.Adding rules for authorized inbound traffic. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ To enable established connections to continue $ sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT To permit SSH connections $ sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT To allow traffic to a HTTP server $ sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT Saving the rules on iptables # iptables-save > /etc/iptables/rules.v4 Confirm if the rules were added. $ sudo iptables -L @@@@@@@@@@@@@@@@@@@@@ 3.Flushing the rules @@@@@@@@@@@@@@@@@@@@@ To clear the input chain $ sudo iptables -F INPUT To flush the entire Iptables $ sudo iptables -F Saving the rules on iptables # iptables-save > /etc/iptables/rules.v4 Display the file contents in the terminal window, to confirm the iptables rules were flushed $ sudo cat /etc/iptables/rules.v4