How to quickly open a port in Centos 7

  • 2020-05-12 06:37:57
  • OfStack

introduce

CentOS 7 does not use iptables by default, so it is not possible to open port 80 by editing iptables's configuration file

CentOS 7 USES the firewalld firewall

If you want to query whether port 80 is open:


[root@joe-pc ~]# firewall-cmd --query-port=80/tcp
 no

Obviously port 80 is not open

Let's open port 80:


[root@joe-pc ~]# firewall-cmd --add-port=80/tcp
success

conclusion

The above is the way to quickly open the port in Centos 7. I hope the content of this article can help you in your study or work. If you have any questions, you can leave a message to communicate.


Related articles: