Linux防火墙设置

在CentOS7中,有很多CentOS 6中的常用服务发生了变化
其中iptables是其中比较大的一个。防火墙iptables被firewalld取代

centOS 7防火墙命令

查看防火墙状态。 
systemctl status firewalld

临时关闭防火墙命令。重启电脑后,防火墙自动起来。 
systemctl stop firewalld

永久关闭防火墙命令。重启后,防火墙不会自动启动。 
systemctl disable firewalld

打开防火墙命令。 
systemctl enable firewalld   

centOS 6关闭防火墙

#可以查看到iptables服务的当前状态
service iptables status  

#关于启动和关闭防火墙的命令:
1) 重启后生效

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后失效

开启: service iptables start

关闭: service iptables stop 
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容