zoukankan      html  css  js  c++  java
  • Linux防火墙iptables的策略

    iptables策略

      iptables -L #查看现有防火墙所有策略

      iptables -F #清除现有防火墙策略

      只允许特定流量通过,禁用其他流量

    1.允许SSH流量(重要)

      iptables -A INPUT -p tcp --dport 22 -j ACCEPT #-A追加的意思;--dport目标端口的意思

    2.允许DNS流量(重要)

      iptables -I INPUT 1 -p tcp --sport 53 -j ACCEPT

      iptables -I INPUT 1 -p udp --sport 53 -j ACCEPT #-I插入的意思;--sport源目标端口的意思

    3.允许业务流量

      iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT

    4.禁用其他所有流量

      iptables -A INPUT -j DROP

    5.禁用某个访问异常多的ip

     [weblogic@host-192-168-149-56 ~]$ netstat -tn|grep "192.168.149.56"|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -rn

      26 10.212.132.123

      1 10.204.130.158    #首先检查出服务器上各个ip的连接次数;其中netstat -tn命令的-t是检测所有连接的tcp,-n是检测到的不进行域名解析

      iptables -I INPUT 1 -s 10.212.132.123 -j DROP #把这个ip地址禁用掉

  • 相关阅读:
    unity3D相机缓慢看向目标物体
    设计原则
    unity3D中GUI标题内文字滚动效果
    python3.6中安装PyQt报错
    codeforces 515B.Drazil and His Happy Friends
    HDU 1029 Ignatius and the Princess IV
    POJ 1052 Plato's Blocks
    Uva220 Othello
    uva201 Squares
    uva1587 Box
  • 原文地址:https://www.cnblogs.com/AlwaysWIN/p/6113569.html
Copyright © 2011-2022 走看看