CentOS6關(guān)閉防火墻使用以下命令,

CentOS7中若使用同樣的命令會報(bào)錯(cuò),
????stopiptables.service
????Failedtostopiptables.service: Unit iptables.servicenotloaded.
這是因?yàn)镃entOS7版本后防火墻默認(rèn)使用firewalld,因此在CentOS7中關(guān)閉防火墻使用以下命令,
????//臨時(shí)關(guān)閉systemctl stop firewalld
????//禁止開機(jī)啟動systemctl disable firewalld
????Removed symlink/etc/systemd/system/multi-user.target.wants/firewalld.service.
????Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
當(dāng)然,如果安裝了iptables-service,也可以使用下面的命令,
????yum install -y iptables-services
????//關(guān)閉防火墻
????service iptables stop
????Redirectingto/bin/systemctlstopiptables.service
????//檢查防火墻狀態(tài)
????service iptables status?