1) backup your current config file
sudo cp /etc/sysconfig/iptables /etc/sysconfig/iptables.orig
2) Edit the file /etc/sysconfig/iptables with your favorite editor (vi) and add the following lines
*filter
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j DROP
COMMIT
3) Restart the iptables firewall
sudo service iptables restart
4) Enjoy
Note: This testing was done on CentOS 6.0