首頁 > 運維 > CentOS > 主體

centos關閉防火牆指令是什麼

coldplay.xixi
發布: 2021-02-24 16:59:21
原創
60186 人瀏覽過

centos關閉防火牆指令:1、暫時關閉,代號為【systemctl stop firewalld】;2、禁止開機啟動,代號為【systemctl disable firewalld】。

centos關閉防火牆指令是什麼

本文操作環境:Windows7系統,centos6&¢os7版本,Dell G3電腦。

centos關閉防火牆指令:

CentOS6關閉防火牆使用下列指令,

//临时关闭
service iptables stop
//禁止开机启动
chkconfig iptables off
登入後複製

CentOS7中若使用相同的指令會報錯,

stop  iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
登入後複製

這是因為CentOS7版本後防火牆預設使用firewalld,因此在CentOS7中關閉防火牆使用以下指令,

//临时关闭
systemctl stop firewalld
//禁止开机启动
systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
登入後複製

當然,如果安裝了iptables-service,也可以使用下面的指令,

yum install -y iptables-services
//关闭防火墙
service iptables stop
Redirecting to /bin/systemctl stop  iptables.service
//检查防火墙状态
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)
登入後複製

#相關免費推薦:##程式設計影片課程

以上是centos關閉防火牆指令是什麼的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡[email protected]
作者最新文章
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!