Welcome to Etherbox!

This pad text is synchronized as you type, so that everyone viewing this page sees the same text. Add __NOPUBLISH__ to prevent this pad from being archived.
Please leave feedback on any experience using the "Internet" without GAF:
    
    













------------------------------------------------------------------------------------------------------
SCRIPT to use ipset to block by AS (on OpenWRT):

#!/bin/sh
#
## ips.sh domain.com name 
#
IP=`nslookup $1 | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1 | cut -d\  -f3`
AS=`wget -q -O - http://ipinfo.io/$IP/org | cut -f1 -d \  | sed -e 's/AS//'`

echo '#!/bin/sh' > add_$2.sh
chmod 750 add_$2.sh
echo '#!/bin/sh' > del_$2.sh
chmod 750 del_$2.sh
NETWORKS=`wget -O - http://stat.ripe.net/data/announced-prefixes/data.yaml?resource=$AS |grep prefix\:|grep -v \:\:|awk '{print $3}'`

echo "ipset create $2_ip hash:net" >> add_$2.sh
echo "iptables -A forwarding_rule -m set --match-set $2_ip dst -j reject" >> add_$2.sh

for i in $NETWORKS; do echo "ipset add $2_ip $i" >> add_$2.sh; done

echo "ipset destroy $2_ip" >> del_$2.sh