https://linuxconfig.org/how-to-open-http-port-80-on-redhat-7-linux-using-firewall-cmd
Open port 80 on RHEL
By default, the port 80 for http connection is filtered on Redhat 7 and 8 as you can only access this port from the actual localhost and not from any other public host. To open a port 80 on RHEL 7 and 8 Linux we need to add an iptables rule. For this RHEL uses firewall-cmd.- First add your port 80 rule with the following linux command:
# firewall-cmd --zone=public --add-port=80/tcp --permanent
- Once you add the above firewall rule, reload the firewall service with this command:
# firewall-cmd --reload
- And check whether the port was added to iptables rule:
# iptables-save | grep 80 -A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
- If you decide to block/remove http port 80 firewall rule you can again use the
firewall-cmd
command:# iptables-save | grep 80 -A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT # firewall-cmd --zone=public --remove-port=80/tcp --permanent success # firewall-cmd --reload success # iptables-save | grep 80
No comments:
Post a Comment