Linux下檢視 關閉及開啟防火牆命令

2021-07-14 17:21:03 字數 530 閱讀 2278

linux下檢視、關閉及開啟防火牆命令

1)永久性生效,重啟後不會復原 

開啟: chkconfig iptables on 關閉: chkconfig iptables off 

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

開啟: service iptables start 關閉: service iptables stop 

需要說明的是對於linux下的其它服務都可以用以上命令執行開啟和關閉操作。 

在開啟了防火牆時,做如下設定,開啟相關埠, 修改/etc/sysconfig/iptables 檔案,新增以下內容: 

-a rh-firewall-1-input -m state --state new -m tcp -p tcp --dport 80 -j accept 

-a rh-firewall-1-input -m state --state new -m tcp -p tcp --dport 22 -j accept

3)檢視防火牆狀態

chkconfig iptables --list

Linux下檢視 關閉及開啟防火牆命令

linux下檢視 關閉及開啟防火牆命令 1 永久性生效,重啟後不會復原 開啟 chkconfig iptables on 關閉 chkconfig iptables off 2 即時生效,重啟後復原 開啟 service iptables start 關閉 service iptables stop...

linux檢視防火牆狀態及開啟關閉命令

存在以下兩種方式 一 service方式 檢視防火牆狀態 root centos6 service iptables status iptables 未執行防火牆。開啟防火牆 root centos6 service iptables start 關閉防火牆 root centos6 service...

linux檢視防火牆狀態及開啟關閉命令

存在以下兩種方式 一 service方式 檢視防火牆狀態 root centos6 service iptables status iptables 未執行防火牆。開啟防火牆 root centos6 service iptables start 關閉防火牆 root centos6 service...