Re: Or, simply...
I found an interesting script that will regect IP addresses by their AS number in IPtables:
/usr/bin/whois -h "whois.radb.net" -- '-i origin AS32934' | \
egrep "^route:" | \
awk '{print $NF}' | \
sed -r 's/(.*)/iptables -I OUTPUT -d \1 -j REJECT/' | \
sudo -s source /dev/stdin
# In this example, the AS number belongs to our "friends" at Facebook
There are caveats to this of course and as always, YMMV