Re: ICMP, SYN, ACK flooding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 05 December 2003 17:11, Robert Gil wrote:
> In this script for iptables i cant seem to get the icmp flood protection
> to work. Im limiting the icmp to 1/s and a burst of 4... (under ping of
> death), same goes for syn flood allthough im not quite sure how to test
> syn/ack/fin/xmas flooding. And how can i go about closing all ports to
> syn packets except the ones listed so i dont have the responding.
> Perhaps i have some things in the wrong order. Any help would be great.
>
>               ~Rob Gil
> #######################################################
> iptables -P INPUT DROP
> iptables -P FORWARD DROP
> iptables -P OUTPUT ACCEPT
>
> iptables -A INPUT -j ACCEPT -p tcp --dport 21
> iptables -A INPUT -j ACCEPT -p tcp --dport 22
> iptables -A INPUT -j ACCEPT -p tcp --dport 25
> iptables -A INPUT -j ACCEPT -p tcp --dport 80
> iptables -A INPUT -j ACCEPT -p tcp --dport 110
> iptables -A INPUT -j ACCEPT -p tcp --dport 443
>
> iptables -A INPUT -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -p udp -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
>

As a general rule it's good to have the ESTABLISHED, RELATED rule ahead of the 
generic ACCEPT rules since they will catch most of your packets.

Jeff



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux