Centos6.5/6.8 64位缺少防火墙配置文件及内部的相应配置

来源:互联网 发布:java instance 编辑:程序博客网 时间:2024/06/05 03:42
 之前用的是Centos6.5 32位的系统镜像,在配置防火墙设置的时,在/etc/sysconfig目录下都有iptables配置文件,但是之后再换到64位的时候,配置时却找不到,之后去查了一下,确实有这种情况。

iptables的添加方法

  1. 任意执行一条iptables的防火墙配置规则指令

    iptables -P OUTPUT ACCEPT
  2. 对iptables配置进行保存

    service iptables save
  3. 重启 iptables服务器

    service iptables restart

防火墙iptables文档的配置参考

/etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall  # Manual customization of this file is not recommended.  *filter  :INPUT ACCEPT [0:0]  :FORWARD ACCEPT [0:0]  :OUTPUT ACCEPT [0:0]  -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT  -A INPUT -p icmp -j ACCEPT  -A INPUT -i lo -j ACCEPT  -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT  -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT  -A INPUT -m state --state NEW -m tcp -p tcp --dport 8686 -j ACCEPT  -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT   -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT  -A INPUT -j REJECT --reject-with icmp-host-prohibited  -A FORWARD -j REJECT --reject-with icmp-host-prohibited  COMMIT
1 0
原创粉丝点击