CentOS 6和Centos 7防火牆命令

CentOS 6 防火牆的關閉,關閉其服務即可:
查看CentOS防火牆信息:/etc/init.d/iptables status
關閉CentOS防火牆服務:/etc/init.d/iptables stop
開啓CentOS防火牆服務:/etc/init.d/iptables start
在這裏插入圖片描述
CentOS 7 防火牆服務命令:

關閉防火牆
1) 永久性生效,重啓後不會復原

開啓: chkconfig iptables on

關閉: chkconfig iptables off

2) 即時生效,重啓後復原

開啓: service iptables start

關閉: service iptables stop

查看防火牆狀態: service iptables status
systemctl stop firewalld.service #停止防火牆
systemctl disable firewalld.service #禁止防火牆開機啓動
firewall-cmd --state #查看防火牆狀態

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章