$ type bgproute
bgproute est une fonction
bgproute () 
{ 
    ip=$1;
    if [ -z "$1" ]; then
        ip=$(dig +short myip.opendns.com @resolver1.opendns.com);
        echo "Using IP: $ip";
    fi;
    dig +short TXT $(echo $ip | awk -F. '{print $4 "." $3 "." $2 "." $1 ".aspath.routeviews.org" }') @asnums.routeviews.org | awk -F\" '{print "AS path: " $2 "\nRoute: " $4 "/" $6 }'
}

http://bgp.potaroo.net/as1221/asnames.txt
http://www.team-cymru.org/Services/ip-to-asn.html
http://www.shadowserver.org/wiki/pmwiki.php/Services/IP-BGP

$ whois -h asn.shadowserver.org origin 17.112.152.32
714 | 17.112.0.0/16 | APPLE-ENGINEERING | US | APPLE.COM | APPLE COMPUTER INC 

$ dig +short TXT 32.112.191.88.aspath.routeviews.org @asnums.routeviews.org
"11686 19151 12322" "88.160.0.0" "11"

$ dig +short TXT AS5511.asn.cymru.com 
"5511 | FR | ripencc | 1996-01-08 | OPENTRANSIT France Telecom S.A."

$ type get_routes_from_as 
get_routes_from_as est une fonction
get_routes_from_as () 
{
  AS=$1;
  if [ -z "$1" ]; then
    AS=$(whois -h asn.shadowserver.org origin $(dig +short @208.67.222.220 myip.opendns.com) | awk -F" " '{print $1}');
  fi;
  whois -h asn.shadowserver.org prefix $AS
}

$ get_routes_from_as 50618
91.226.98.0/24
178.20.48.0/21
192.175.37.0/24
195.88.84.0/23

$ for pfx in $(get_routes_from_as 50618); do echo iptables -A INPUT -s $pfx -j DROP; done
iptables -A INPUT -s 91.226.98.0/24 -j DROP
iptables -A INPUT -s 178.20.48.0/21 -j DROP



$ dig +short TXT $(echo 2a00:1450:4007:805::1003 | rev | sed 's/://g' | sed 's/.\{1\}/&./g' | echo "$(cat - )origin6.asn.cymru.com") | sed 's/\"//g' | awk -F\| '{print "Origin: " $1 "\nRoute: " $2 }'

$ dig': dig +short TXT 3.0.0.1.5.0.8.7.0.0.4.0.5.4.1.0.0.a.2.origin6.asn.cymru.com | sed 's/\"//g' | awk -F\| '{print "Origin: " $1 "\nRoute: " $2 }'