CentOS 7.0默认使用的是firewall作为防火墙,之前版本是使用iptables。
所以在CentOS 7执行下面命令是无法查看防火墙状态的。
[root@localhost ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.
查看防火墙是否关闭
firewall-cmd –state
[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]#
开启防火墙
[root@localhost ~]