启动防火墙
systemctl start firewalld
关闭防火墙
systemctl stop firewalld
查看防火墙状态
systemctl status firewalld
开机禁用防火墙
systemctl disable firewalld
开机启用防火墙
systemctl enable firewalld
防火墙添加端口
firewall-cmd --zone=public --add-port=80/tcp --permanent (–permanent永久生效,没有此参数重启后失效)
重新载入防火墙策略
firewall-cmd --reload
查看防火墙端口开放
firewall-cmd --zone= public --query-port=80/tcp
删除防火墙已开放端口
firewall-cmd --zone= public --remove-port=80/tcp --permanent
保存iptables规则
iptables-save > /home/ymh/iptables.rules
载入规则
iptables-restore /home/ymh/iptables.rules