Firewall 手册
开启服务
https://blog.csdn.net/zll_0405/article/details/81208606
开启端口
firewall-cmd --zone=public --add-port=6379/tcp --permanent
防火墙开机启动
systemctl enable firewalld.service
查看防火墙状态
firewall-cmd --state
开启防火墙
systemctl start firewalld.service
开放8080,3306,6379端口
firewall-cmd --zone=public --add-port=1000/tcp --permanent
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --zone=public --add-port=9200/tcp --permanent
删除端口
firewall-cmd --zone=public --remove-port=8888/udp --permanent
开放范围端口
firewall-cmd --permanent --zone=public --add-port=1-65535/tcp
删除范围端口
firewall-cmd --permanent --zone=public --remove-port=8840-8900/tcp
重启
systemctl restart firewalld.service
重新加载配置
firewall-cmd --reload
查看防火墙状态
systemctl status firewalld
设置开机自启
systemctl start firewalld
systemctl enable firewalld
查看防火墙所有开放的端口
firewall-cmd --zone=public --list-ports
关闭防火墙
关闭自启
systemctl disable firewalld
停止服务
systemctl stop firewalld