The open and closed viewing ports of CentOS7 are controlled by firewalls. The specific commands are as follows:
Check out the open ports:
firewall-cmd --list-ports
open port
firewall-cmd --zone=public --add-port=80/tcp --permanent
Command meaning:
--zone #scope
–add-port=80/tcp #Add port, the format is: port/communication protocol
–permanent #Permanent effect, invalid after restart without this parameter
restart firewall
#Restart firewall firewall-cmd --reload #stop firewall systemctl stop firewalld.service #Disable firewall startup systemctl disable firewalld.service