CentOS7 view open port command

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

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326306284&siteId=291194637