如何查linux 看防火墻是否開啟
2016-08-03 00:18:34
10172
Linux下查看、關(guān)閉及開啟防火墻命令
service iptables status可以查看到iptables服務(wù)的當(dāng)前狀態(tài)。

1)永久性生效,重啟后不會(huì)復(fù)原
開啟: chkconfig iptables on 關(guān)閉: chkconfig iptables off
2)即時(shí)生效,重啟后復(fù)原
開啟: service iptables start 關(guān)閉: service iptables stop
需要說明的是對于Linux下的其它服務(wù)都可以用以上命令執(zhí)行開啟和關(guān)閉操作。
在開啟了防火墻時(shí),做如下設(shè)置,開啟相關(guān)端口, 修改/etc/sysconfig/iptables 文件,添加以下內(nèi)容:
-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)查看防火墻狀態(tài)
chkconfig iptables --list
會(huì)員登錄
賬號(hào)登錄還沒有賬號(hào)?立即注冊