I just want to surf the web and be a web server but it's not working.
My rules are:
-P INPUT DROP
-P OUTPUT DROP
-P FORWARD DROP
-A INPUT -p tcp --dport 80 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
Also, I am not quite sure about those states. Which ones are useless in my case, and why?
Thanks a lot for your help.
EDIT
I still can't surf the internet. With these rules, I want my server to be a web server and at the same time, be able to surf the internet from this machine (this is just for practice)
Here are my updated rules. What's wrong with them? (I added two lines for DNS port, not sure if they're useful or correct)
-P INPUT DROP
-P OUTPUT DROP
-P FORWARD DROP
-I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-I OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
-A OUTPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
-A OUTPUT -p tcp --dport 53 -j ACCEPT
-A INPUT -p tcp --dport 53 -j ACCEPT
-A OUTPUT -j LOG
at the end of the rules to see what's getting dropped. This will give you a hint as to what you're dropping that needs to pass. Especially if it's just for practice, since you will learn something that way.