BIP KB:
How To Open http Port 80 On Redhat 7 Linux Using firewall-cmd

Article By tapish01 Ranjan


BIP media KB Knowledge Base Community Author

In this tutorial you will learn how to open port 80 on Redhat 7. By default, port 80 for the http connection is filtered on Redhat 7. You can only access this port from the actual localhost and not from any other public host. To open port 80 on RHEL 7 Linux we need to add an iptables rule. For this RHEL7 uses firewall-cmd.

redhat firewall VPS BIP media

First add your port 80 rule with a following command:

[root@bip1987 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent

Once you add the above rule reload the service:

[root@bip1987 ~]# firewall-cmd --reload

And check whether the port was added to ipatables rules:

[root@bip1987 ~]# 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 the http port 80 rule you can again and use the cmd command:

[root@bip1987 ~]# iptables-save | grep 80
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
[root@bip1987 ~]# firewall-cmd --zone=public --remove-port=80/tcp --permanent
success
[root@bip1987 ~]# firewall-cmd --reload
success
[root@bip1987 ~]# iptables-save | grep 80
[root@bip1987 ~]# 

I hope this short tutorial on how to open http port 80 On Redhat 7 Linux using cmd command was helpful. If you have any questions and or comments simply add it to the form below and I will be happy to assist you.




Tags: , , , , , , , ,

Spin up a VPS server in no time flat

Simple setup. Full root access. Straightforward pricing.

DEPLOY VPS SERVER

Leave a Reply



Feedbacks