#setenforce 0 ?????//临时关闭selinux
#vi /etc/selinux/config ??????//永久关闭selinux需要修改这个配置文件
将SELINUX=enforcing修改为SELINUX=disabled
#getenforce ????//查看selinux是否关闭
centos7之前使用netfilter防火墙
centos7开始使用firewalld防火墙
以下是在centos7上关闭firewalld防火墙,使用centos6上的netfilter防火墙
#systemctl disable firewalld ???????//禁用firewalld
#systemctl stop firewalld ?????????//停止firewalld
#yum install -y iptables-services ????//yum安装iptables-services
#systemctl enable iptables ??????//启用iptables
#systemctl start iptables ?????????//开启iptables
#iptables -nvL ???????????//查看itables默认规则
关闭centos7上的firewalld,启用centos6之前用的netfilter总结:
firewalld --> close / disable + stop
netfilter --> open --> yum安装iptables-services --> enable iptables / start iptables ???
注意:真正的防火墙是netfilnet,而iptables仅仅是它的工具
firewalld和netfilter
原文地址:http://blog.51cto.com/13669226/2114250