CentOS firewall port open command set

Check the status of the firewall:
systemctl status firewalld
sees active (running) indicating that it has been turned on

Start the firewall:
systemctl start firewalld

View all open ports in the firewall:
firewall-cmd --zone=public --list-ports

Open port, for example, I want to open port 8888:
firewall-cmd --zone=public --add-port=8888/tcp --permanent

If you need to close this port:
firewall-cmd --zone=public --remove-port=8888/tcp --permanent

Restart the firewall to make the configuration take effect:
firewall-cmd --reload

Turn off the firewall:
systemctl stop firewalld

Set boot firewall:
systemctl disable firewalld

Guess you like

Origin blog.csdn.net/Tanganling/article/details/128248850