iptables默认配置文件的位置在哪里
/etc/sysconfig/iptables
vi /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Thu Nov 29 20:37:50 2012
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [237475:35650933]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6945 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 55672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7180 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 2181 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 2888 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 3888 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 1808 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 11211 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 22423 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 22422 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 22424 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 17341 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 5672 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 7180 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 3050 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 3060 -j ACCEPT
-A INPUT -s 192.168.80.0/24 -p tcp -m state --state NEW -m tcp --dport 3070 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Thu Nov 29 20:37:50 2012
~
修改完后,重启服务: service iptables restart;