1.查看已经开放的端口号
firewall-cmd --list-ports
2.开放端口(开放后需要要重启防火墙才生效)
firewall-cmd --zone=public --add-port=3338/tcp --permanent
3.重启防火墙
firewall-cmd --reload
4.关闭端口(关闭后需要要重启防火墙才生效)
firewall-cmd --zone=public --remove-port=3306/tcp --permanent
5.开机启动防火墙
systemctl enable firewalld
6.开启防火墙
systemctl start firewalld
7.禁止防火墙开机启动
systemctl disable firewalld
8.停止防火墙
systemctl stop firewalld