zoukankan      html  css  js  c++  java
  • iptables

    在iptables中有几个不同的链。
    iptables -A INPUT -p tcp -s x.x.x.x/x --dport 22 -j ACCEPT // 允许源地址为x.x.x.x/x的主机通过22(ssh)端口.
    iptables -A INPUT -p tcp --dport 80 -j ACCEPT // 允许80(http)端口的数据包进入
    iptables -A INPUT -p tcp --dport 110 -j ACCEPT // 允许110(pop3)端口的数据包进入如果不加这规则,就只能通过web页面来收信(无法用OE或Foxmail等来收)
    iptables -A INPUT -p tcp --dport 25 -j ACCEPT // 允许25(smtp)端口的数据包进入,如果不加这规则,就只能通过web页面来发信(无法用OE或Foxmail等来发)
    iptables -A INPUT -p tcp --dport 21 -j ACCEPT  // 允许21(ftp)端口的数据包进入(传数据)     
    iptables -A INPUT -p tcp --dport 20 -j ACCEPT  // 允许20(ftp)端口的数据包进入(执行ftp命令,如dir等)
    iptables -A INPUT -p tcp --dport 53 -j ACCEPT  // 允许53(dns)端口的数据包进入(tcp)
    iptables -A INPUT -p udp --dport 53 -j ACCEPT  // 允许53(dns)端口的数据包进入(udp)
    iptables -A INPUT -p icmp -j ACCEPT // 允许ICMP包通过
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT //利用 iptables 对连接状态的支持
    iptables -P INPUT DROP //把INPUT链的默认规则设置为DROP

  • 相关阅读:
    tomcat 支持https
    linux环境下jdk 安装以及maven私服搭建
    消息中间间初识
    HDU 5527 Too Rich
    HDU 5534 Partial Tree
    HDU 5543 Pick The Sticks
    HDU 5542 The Battle of Chibi dp+树状数组
    CodeForces 842D Vitya and Strange Lesson
    Codeforces 858D Polycarp's phone book
    HDU 5489 Removed Interval
  • 原文地址:https://www.cnblogs.com/hllnj2008/p/3995870.html
Copyright © 2011-2022 走看看