Blocking All ports except for port 80 and 443

Latest response

Hi All,

I would like to block all ports for in-going and outgoing traffic.
Using Iptables.

However I would like to keep port 80 and 443 open.

I used the following commands:
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -FORWARD DROP

And thus I sucssfully closed all traffic, following those commands i tried using the following commands in order to open port 80 for example:

Iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

I have done the same for port 443, however I am unable to open HTTP and HTTPS pages.

Kindly advice,
Any assistance will be appreciated.

Regards,
Ofir

Responses