- 資訊首頁(yè) > 互聯(lián)網(wǎng) > 經(jīng)驗分享 >
- linux服務(wù)器CentOS7/6查看防火墻狀態(tài)及開(kāi)啟關(guān)閉命令
CentOS7 的防火墻配置跟以前版本有很大區別,CentOS7這個(gè)版本的防火墻默認使用的是firewall,與之前的版本使用iptables不一樣
1、關(guān)閉防火墻:
systemctl stop firewalld.service
connection closed.
Disconnected from remote host(.7) at 17:21:23.
Type 'help' to learn how to use Xshell prompt
[d:~]$
Connecting to 192.168.0.7:22...
Connection established.
To escape to local shell, press 'Ctrl Alt ]'.
Last login: Fri May 12 16:53:10 2017 from 192.168.0.221...
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]#
2、開(kāi)啟防火墻:
systemctl start firewalld.service
3、關(guān)閉開(kāi)機啟動(dòng):
systemctl disable firewalld.service
4、開(kāi)啟開(kāi)機啟動(dòng):
systemctl enable firewalld.service
存在以下兩種方式:
一、service方式
查看防火墻狀態(tài):
[root@centos6 ~]# service iptables status
iptables:未運行防火墻。
開(kāi)啟防火墻:
[root@centos6 ~]# service iptables start
關(guān)閉防火墻:
[root@centos6 ~]# service iptables stop
二、iptables方式
先進(jìn)入init.d目錄,命令如下:
[root@centos6 ~]# cd /etc/init.d/
[root@centos6 init.d]#
然后
查看防火墻狀態(tài):
[root@centos6 init.d]# /etc/init.d/iptables status
暫時(shí)關(guān)閉防火墻:
[root@centos6 init.d]# /etc/init.d/iptables stop
重啟iptables:
[root@centos6 init.d]# /etc/init.d/iptables restart
原文鏈接:https://blog.csdn.net/xc_zhou/article/details/80879810
來(lái)源鏈接:https://www.zyhot.com/article/5906.html
本站聲明:網(wǎng)站內容來(lái)源于網(wǎng)絡(luò ),如有侵權,請聯(lián)系我們,我們將及時(shí)處理。
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站