0
I have tried to open port 80
[root@rhel7 docker]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
[root@rhel7 docker]# firewall-cmd --reload
success
[root@rhel7 docker]# iptables-save | grep 80
-A POSTROUTING_ZONES -o eno16780032 -g POST_public
-A PREROUTING_ZONES -i eno16780032 -g PRE_public
-A PREROUTING_ZONES -i eno16780032 -g PRE_public
-A FORWARD_IN_ZONES -i eno16780032 -g FWDI_public
-A FORWARD_OUT_ZONES -o eno16780032 -g FWDO_public
-A INPUT_ZONES -i eno16780032 -g IN_public
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
but when I try to use
netstat -an
It didnt show up port 80 are listening. When I try to telnet the port, it shows the following
[root@rhel7 docker]# telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Anyways to resolve?
Thanks.
Do you run any program that actually listens on that port? – Kamil Maciorowski – 2016-05-24T08:05:07.443
no...I just set up this new machine, any configuration I should do? – kan1207 – 2016-05-24T08:25:22.263
What do you expect to answer on this port? HTTP server maybe? – Kamil Maciorowski – 2016-05-24T08:28:20.883
1You need to run any application that occupies the port 80 ex a webserver. If the webserver starts, you can see listen on netstat -an command. – vembutech – 2016-05-24T08:29:04.263
The firewall does not affect
netstat
output (ie. whether programs can listen). It just controls whether anyone can connect to the listener. – Daniel B – 2016-05-24T08:38:27.253