防火墙开启某端口:

firewall-cmd --zone=public --add-port=8888/tcp --permanent


防火墙关闭某端口:

firewall-cmd --zone=public --remove-port=8888/tcp --permanent


防火墙查看某个端口状态:

firewall-cmd --query-port=8888/tcp


查看已经开放的端口:

firewall-cmd --list-ports  


重启防火墙:

firewall-cmd --reload


关闭防火墙:

systemctl stop firewalld.service


开启防火墙:

systemctl start firewalld.service


设置开机自启

systemctl enable firewalld.service


设置开启不自启

systemctl disable firewalld.service