Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Blocking All ports except for port 80 and 443

    Posted on

    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

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat