Posted on 2008-02-21 14:22
生活在別處 閱讀(852)
評論(0) 編輯 收藏 所屬分類:
Java
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
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT