linux中防火墙开启和关闭

因为centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙。

systemctl stop firewalld  
systemctl mask firewalld

1.service方式

查看防火墙状态:service iptables status

开启防火墙:service iptables start

关闭防火墙:service iptables stop

 报错访问:https:////www.cnblogs.com/HUIWANG/articles/12298628.html

2.iptables 方式

查看防火墙状态:/etc/init.d/iptables status

重启防火墙:/etc/init.d/iptables restart

暂时关闭防火墙:/etc/init.d/iptables stop

posted @ 2020-02-12 12:50  hui1019  阅读(1039)  评论(0编辑  收藏  举报