Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iptables -t raw -F
- iptables -t raw -X
- iptables -t raw -N icmp_dst
- iptables -t raw -A icmp_dst -p icmp -m hashlimit \
- --hashlimit 60/sec \
- --hashlimit-burst 80 \
- --hashlimit-mode dstip \
- --hashlimit-name icmp_dst \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A icmp_dst -p icmp -j DROP
- iptables -t raw -N icmp_src
- iptables -t raw -A icmp_src -p icmp -m hashlimit \
- --hashlimit 60/sec \
- --hashlimit-burst 80 \
- --hashlimit-mode srcip \
- --hashlimit-name icmp_src \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A icmp_src -p icmp -j DROP
- iptables -t raw -N syn_dst
- iptables -t raw -A syn_dst -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m hashlimit \
- --hashlimit 100/sec \
- --hashlimit-burst 100 \
- --hashlimit-mode dstip \
- --hashlimit-name syn_dst \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A syn_dst -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
- iptables -t raw -N syn_src
- iptables -t raw -A syn_src -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m hashlimit \
- --hashlimit 20/sec \
- --hashlimit-burst 50 \
- --hashlimit-mode srcip \
- --hashlimit-name syn_src \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A syn_src -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
- iptables -t raw -N udp_dst
- iptables -t raw -A udp_dst -p udp -m hashlimit \
- --hashlimit 3500/sec \
- --hashlimit-burst 5000 \
- --hashlimit-mode dstip \
- --hashlimit-name udp_dst \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A udp_dst -p udp -j DROP
- iptables -t raw -N udp_src
- iptables -t raw -A udp_src -p udp -m hashlimit \
- --hashlimit 500/sec \
- --hashlimit-burst 750 \
- --hashlimit-mode srcip \
- --hashlimit-name udp_src \
- --hashlimit-htable-expire 12000 \
- --hashlimit-htable-size 65536 \
- --hashlimit-htable-max $((4*1024*1024)) \
- -j RETURN
- iptables -t raw -A udp_src -p udp -j DROP
- iptables -t raw -N antiflood-in
- iptables -t raw -A antiflood-in -p tcp -j syn_src
- iptables -t raw -A antiflood-in -p tcp -j syn_dst
- iptables -t raw -A antiflood-in -p udp -j udp_src
- iptables -t raw -A antiflood-in -p udp -j udp_dst
- iptables -t raw -A antiflood-in -p icmp -j icmp_src
- iptables -t raw -A antiflood-in -p icmp -j icmp_dst
- iptables -t raw -A PREROUTING -i eth0 -j antiflood-in
Add Comment
Please, Sign In to add comment