How to block all ports in IPTABLES except 80 & 443

This maybe particularly useful for those who need to know how to block all ports in IPTABLES except 80 & 443 (Linux Firewall – Centos 5.5).

Type in:

sudo iptables -A INPUT -p tcp -i eth0 –dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp -i eth0 –dport 443 -j ACCEPT
service iptables save

Image:

Enjoy.

Facebook Comments