1.查看防火墙状态:runing或者not running
firewall-cmd --state
2.关闭防火墙:
systemctl stop firewalld.service
3.开启防火墙
systemctl start firewalld
4.开放某个端口:
firewall-cmd --permanent --zone=public --add-port=8080/tcp
一般开放某个端口后都要重启防火墙服务:
systemctl restart firewalld.service
5.关闭某个端口
firewall-cmd --permanent --zone=public --remove-port=3306/tcp
6.查看所有开放的端口
firewall-cmd --zone=public --list-ports