Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Anyone knows where I can get list of Autonomous system number users by country ? If it is not possible to get it by country, any kind of list will suffice. thnx

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

One good list can be found at: http://bgp.potaroo.net/cidr/autnums.html

Its harder to get them sorted by "country" since lots of organisations span several continents and might use the same AS globally, but the world is split up into regional registries so you can see atleast what region gave out the specific AS number. So for Europe, for example, you have RIPE. A list of AS numbers and what region they were given out to can be found at:
http://www.iana.org/assignments/as-numbers/as-numbers.xml

If you want to do some manual processing you can get information from this file too:
ftp://ftp.ripe.net/ripe/stats/delegated-ripencc-latest

Fields are split by |. The second field is country code, the third field type (asn for AS number) and the fourth field the actual AS number. Since its a text file you can easily import it in Excel and search around, or if you have access to command line utilities you can query it that way. An example from Linux with awk to list all AS numbers delegated to Sweden.

awk -F\| '{if ($2 == "SE" && $3 == "asn" ) print $4}' < delegated-ripencc-latest

To search for Russia replace SE with RU.

A bit more advanced from a Linux prompt, to download the RIPE database file, to sort out all AS numbers from russia, then prepare an input file for an AS number lookup service (from Team Cymru), then send the request file and save the output to asn.ru you you can do something like this, line by line into your Linux shell:

wget ftp://ftp.ripe.net/ripe/stats/delegated-ripencc-latest
awk -F\| '{if ($2 == "RU" && $3 == "asn" ) print $4}' < delegated-ripencc-latest > output.txt
sed -i -e 's/^/AS/' output.txt
(echo begin;echo verbose;cat output.txt;echo end) > input.txt
nc whois.cymru.com whois < input.txt > asn.ru

Then your asn.ru will output something like this:

Bulk mode; whois.cymru.com [2012-01-18 19:09:55 +0000]
2118    | RU | ripencc  | 1993-02-17 | RELCOM-AS OOO _NPO Relcom_
2122    | RU | ripencc  | 2000-06-30 | JSC PIOGLOBAL Asset Management, www.pioglobal.ru
2587    | RU | ripencc  | 1995-03-23 | FREE-NET-AS2587 OOO FREEnet Group
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.