CentOS 7.x 默认使用的是firewall作为防火墙,取代6.x的iptables
命令如下
firewall-cmd --state该命令有两种结果:running、not running;前者代表是开启状态,后者代表是关闭状态
在 vmware 上安装的centos7最小化镜像防火墙默认是开机自启的

开启防火墙
systemctl start firewalld.service关闭防火墙
systemctl stop firewalld.service防火墙开机自启
systemctl enable firewalld.service重启防火墙
systemctl restart firewalld.service禁止防火墙开机自启
systemctl disable firewalld.service重启
reboot关机(其实有很多方式,这里只写一种)
init 0