4

Cron and iptables

view full story
linux-howto

http://serverfault.com – I am sorry. I have no understanding in server. I am getting tired of ddoses from one person. Basically I am asking how I can make a cron job that does: netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n And if an IP has more than 100 connections. Do: iptables -A INPUT -s *ipaddress here* -j DROP And then /etc/init.d/apache2 restart How can I do this in debian and doing this cron every minute 15. My first problem is, how can I read the results from the first command and then make a if statement? Thanks in advance. (HowTos)