#!/bin/bash #Copyright 2004 William Stearns #Released under the GPL #Automatically generated by Modwall, http://www.stearns.org/modwall/ #==== Iptables modules required ==== recent #==== Brick specific help ==== # The banfor30 module provides a chain which, if called by some other #rule, bans that source IP from making NEW connections for 30 seconds. #Actually, this chain just _remembers_ the source IP in the "banfor30" #recent table; to actually accomplish a 30 second ban, the "checkbans" #brick must be loaded before NEW traffic rules accept traffic. /usr/bin/sudo /sbin/iptables -N banfor30 /usr/bin/sudo /sbin/iptables -A banfor30 -s 127.0.0.1 -j RETURN /usr/bin/sudo /sbin/iptables -A banfor30 -m recent --name banfor30 --rsource --set -j DROP