service iptables save
3.查看端口是否开放:/sbin/iptables -L -n
二.
#查看防火墙状态
systemctl status firewalld
#开启80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
#开启3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
#重启防火墙:
firewall-cmd --reload