1:查看防火状态
systemctl status firewalld
service iptables status
2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
3:永久关闭防火墙
systemctl disable firewalld 【重启才生效】
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart
5:永久关闭后重启
//暂时还没有试过
chkconfig iptables on
如果在操作永久关闭防火墙的时候出现问题的话:
问题:
服务 iptables 信息读取出错:没有那个文件或目录
解决:
1.首先停止防火墙systemctl stop firewalldsystemctl mask firewalld2.然后安装iptables-servicecentos下:yum install iptables-services -y3.设置开机启动防火墙systemctl enable iptables此时iptables-services安装完毕运行以下命令查看状态service iptables status
如果遇到关闭防火墙无法开启的问题:
执行:
systemctl unmask firewalld
清除残留文件即可。
