lizhengfa 2020-06-26
firewall-cmd --state
systemctl stop firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl enable firewalld.service
firewall-cmd --reload
#说明: #–zone 作用域 #–add-port=80/tcp 添加端口,格式为:端口/通讯协议 #–permanent 永久生效,没有此参数重启后失效 firewall-cmd --zone=public --add-port=端口号/tcp --permanent
firewall-cmd --zone=public --remove-port=端口号/tcp --permanent
# 设置开放某个端口后,需要重启防火墙,才能看到刚刚开启的端口 firewall-cmd --list-ports
firewall-cmd --list-all