centos6.9防火墙设置

1.输入:cat /etc/issue   查看版本

2. service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原。

查看防火墙状态:service iptables status  ,记得在CentOS6.9中是输入iptables,网上有些教程使用service iptable status 命令并不可行。

关闭防火墙:service iptables stop

打开防火墙:service iptables start

通过:/etc/init.d/iptables 进行操作

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

关闭防火墙:/etc/init.d/iptables stop(这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的)

这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的,它相当于/etc/init.d/iptables start

永久开启防火墙: chkconfig iptables on

查看状态:chkconfig --list iptables

永久关闭防火墙:chkconfig iptables off

原文地址:https://www.cnblogs.com/ls-pankong/p/12254657.html