systemctl enable firewalld.service
systemctl disable firewalld.service
systemctl start firewalld
systemctl stop firewalld
systemctl status firewalld
firewall-cmd --state
firewall-cmd --reload
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=9200/tcp --permanent firewall-cmd --reload
firewall-cmd --zone=public --remove-port=9200/tcp --permanent firewall-cmd --reload
命令含义:
–zone #作用域
–add-port=9200/tcp #添加端口,格式为:端口/通讯协议
–permanent #永久生效,没有此参数重启后失效
注意:添加端口后,必须用命令firewall-cmd --reload重新加载一遍才会生效