Iptables Script

d
Visto en The Lone Pole
#!/bin/bash
if [ -z $1 ]; then
        echo "Usage: $0  [reason]";
        exit;
fi

IP=$1
REASON="denied ip"

if [ $# -gt 1 ]; then
        shift;
        REASON=$@
fi

iptables -A INPUT -s ${IP}/32 -j LOG --log-prefix "${REASON} "
iptables -A INPUT -s ${IP}/32 -j DROP

0 comentarios: