zoukankan      html  css  js  c++  java
  • Centos6 iptables 防火墙设置【转】

    1、指令 vi /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 80 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8083 -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 8088 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -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 3000 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3322 -j ACCEPT

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
    -A INPUT -j REJECT --reject-with icmp-host-prohibited
    -A FORWARD -j REJECT --reject-with icmp-host-prohibited
    COMMIT

    ###############保存iptables文件,重启服务###############

    #保存iptables规则
    service iptables save

    #重启iptables服务
    service iptables restart

    svnserve的,默认端口为3690,

  • 相关阅读:
    妙用||和&&
    jQuery细节总结
    Mybatis3.2和Spring3.x整合----Myb…
    SSH整合- 2- add service layout
    SSH整合--1
    MyBatis之ResultMap简介,关联对象…
    BeanFactory和ApplicationContext介绍
    Spring IOC容器
    感知机算法的两种表示
    Python中xPath技术和BeautifulSoup的使用
  • 原文地址:https://www.cnblogs.com/richard1015/p/9505817.html
Copyright © 2011-2022 走看看