Centos6和Centos7查看和关闭防火墙

CentOS6.5:

查看防火墙的状态:

service iptable status

关闭防火墙:

servcie iptables stop           --临时关闭防火墙
chkconfig iptables off          --永久关闭防火墙 

CentOS 7.2:

查看防火墙状态:

firewall-cmd --state
--显示结果为:not running或running

 

检查防火墙的状态:

[root@iZuf6 webapps]# systemctl list-unit-files|grep firewalld.service 
firewalld.service                             disabled

关闭防火墙:

systemctl stop firewalld.service         #停止firewall
systemctl disable firewalld.service      #禁止firewall开机启动

重启防火墙:

firewall-cmd --reload

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章