Guest User

Untitled

a guest
Jul 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1.  
  2.  
  3. iptables -t raw -F
  4.  
  5. iptables -t raw -X
  6.  
  7.  
  8.  
  9. iptables -t raw -N icmp_dst
  10.  
  11. iptables -t raw -A icmp_dst -p icmp -m hashlimit \
  12.  
  13. --hashlimit 60/sec \
  14.  
  15. --hashlimit-burst 80 \
  16.  
  17. --hashlimit-mode dstip \
  18.  
  19. --hashlimit-name icmp_dst \
  20.  
  21. --hashlimit-htable-expire 12000 \
  22.  
  23. --hashlimit-htable-size 65536 \
  24.  
  25. --hashlimit-htable-max $((4*1024*1024)) \
  26.  
  27. -j RETURN
  28.  
  29. iptables -t raw -A icmp_dst -p icmp -j DROP
  30.  
  31.  
  32.  
  33. iptables -t raw -N icmp_src
  34.  
  35. iptables -t raw -A icmp_src -p icmp -m hashlimit \
  36.  
  37. --hashlimit 60/sec \
  38.  
  39. --hashlimit-burst 80 \
  40.  
  41. --hashlimit-mode srcip \
  42.  
  43. --hashlimit-name icmp_src \
  44.  
  45. --hashlimit-htable-expire 12000 \
  46.  
  47. --hashlimit-htable-size 65536 \
  48.  
  49. --hashlimit-htable-max $((4*1024*1024)) \
  50.  
  51. -j RETURN
  52.  
  53. iptables -t raw -A icmp_src -p icmp -j DROP
  54.  
  55.  
  56.  
  57. iptables -t raw -N syn_dst
  58.  
  59. iptables -t raw -A syn_dst -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m hashlimit \
  60.  
  61. --hashlimit 100/sec \
  62.  
  63. --hashlimit-burst 100 \
  64.  
  65. --hashlimit-mode dstip \
  66.  
  67. --hashlimit-name syn_dst \
  68.  
  69. --hashlimit-htable-expire 12000 \
  70.  
  71. --hashlimit-htable-size 65536 \
  72.  
  73. --hashlimit-htable-max $((4*1024*1024)) \
  74.  
  75. -j RETURN
  76.  
  77. iptables -t raw -A syn_dst -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
  78.  
  79.  
  80.  
  81. iptables -t raw -N syn_src
  82.  
  83. iptables -t raw -A syn_src -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m hashlimit \
  84.  
  85. --hashlimit 20/sec \
  86.  
  87. --hashlimit-burst 50 \
  88.  
  89. --hashlimit-mode srcip \
  90.  
  91. --hashlimit-name syn_src \
  92.  
  93. --hashlimit-htable-expire 12000 \
  94.  
  95. --hashlimit-htable-size 65536 \
  96.  
  97. --hashlimit-htable-max $((4*1024*1024)) \
  98.  
  99. -j RETURN
  100.  
  101. iptables -t raw -A syn_src -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
  102.  
  103.  
  104.  
  105. iptables -t raw -N udp_dst
  106.  
  107. iptables -t raw -A udp_dst -p udp -m hashlimit \
  108.  
  109. --hashlimit 3500/sec \
  110.  
  111. --hashlimit-burst 5000 \
  112.  
  113. --hashlimit-mode dstip \
  114.  
  115. --hashlimit-name udp_dst \
  116.  
  117. --hashlimit-htable-expire 12000 \
  118.  
  119. --hashlimit-htable-size 65536 \
  120.  
  121. --hashlimit-htable-max $((4*1024*1024)) \
  122.  
  123. -j RETURN
  124.  
  125. iptables -t raw -A udp_dst -p udp -j DROP
  126.  
  127.  
  128.  
  129. iptables -t raw -N udp_src
  130.  
  131. iptables -t raw -A udp_src -p udp -m hashlimit \
  132.  
  133. --hashlimit 500/sec \
  134.  
  135. --hashlimit-burst 750 \
  136.  
  137. --hashlimit-mode srcip \
  138.  
  139. --hashlimit-name udp_src \
  140.  
  141. --hashlimit-htable-expire 12000 \
  142.  
  143. --hashlimit-htable-size 65536 \
  144.  
  145. --hashlimit-htable-max $((4*1024*1024)) \
  146.  
  147. -j RETURN
  148.  
  149. iptables -t raw -A udp_src -p udp -j DROP
  150.  
  151.  
  152.  
  153. iptables -t raw -N antiflood-in
  154.  
  155. iptables -t raw -A antiflood-in -p tcp -j syn_src
  156.  
  157. iptables -t raw -A antiflood-in -p tcp -j syn_dst
  158.  
  159. iptables -t raw -A antiflood-in -p udp -j udp_src
  160.  
  161. iptables -t raw -A antiflood-in -p udp -j udp_dst
  162.  
  163. iptables -t raw -A antiflood-in -p icmp -j icmp_src
  164.  
  165. iptables -t raw -A antiflood-in -p icmp -j icmp_dst
  166.  
  167.  
  168.  
  169.  
  170.  
  171. iptables -t raw -A PREROUTING -i eth0 -j antiflood-in
Add Comment
Please, Sign In to add comment