let me explain what I did before;
# Only INPUT policy DROP, others are ACCEPT sudo iptables -P INPUT DROP sudo iptables -A INPUT -p tcp --sport 80 -j ACCEPT
I also try this; for these ports to 443 and 8080
sudo iptables -A INPUT -p tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
Then I realized that, I should allow dns server too,
sudo iptables -A INPUT -p udp --sport 53 -j ACCEPT sudo iptables -A INPUT -p tcp --sport 53 -j ACCEPT
Apply this rules but I can not connect internet,
But when I allow all udp port I can connect.
Do I forget something? or do wrong something?