centos關(guān)閉防火墻命令:1、臨時(shí)關(guān)閉,代碼為【systemctl stop firewalld】;2、禁止開機(jī)啟動(dòng),代碼為【systemctl disable firewalld】。
本文操作環(huán)境:Windows7系統(tǒng),centos6&¢os7版本,Dell G3電腦。
centos關(guān)閉防火墻命令:
CentOS6關(guān)閉防火墻使用以下命令,
//臨時(shí)關(guān)閉 service iptables stop //禁止開機(jī)啟動(dòng) chkconfig iptables off
CentOS7中若使用同樣的命令會(huì)報(bào)錯(cuò),
stop iptables.service Failed to stop iptables.service: Unit iptables.service not loaded.
這是因?yàn)镃entOS7版本后防火墻默認(rèn)使用firewalld,因此在CentOS7中關(guān)閉防火墻使用以下命令,
//臨時(shí)關(guān)閉 systemctl stop firewalld //禁止開機(jī)啟動(dòng) 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 Redirecting to /bin/systemctl stop iptables.service //檢查防火墻狀態(tài) service iptables status Redirecting to /bin/systemctl status iptables.service 鈼iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled) Active: inactive (dead)
相關(guān)免費(fèi)推薦:編程視頻課程