Download IP address lists grouped by network provider (ASN)
Find a file
2022-08-24 06:34:02 +02:00
as Update 20220824-0433 2022-08-24 06:34:02 +02:00
as.csv Update README.md 2022-08-14 19:07:11 +02:00
LICENSE Add LICENSE 2021-12-01 07:21:17 +01:00
README.md Update README.md 2022-08-15 15:54:50 +02:00

ipverse-asn-ip

IPv4 and IPv6 networks in CIDR notation (e.g. 100.2.30.0/22) organized by announcing autonomous systems (AS). All networks are aggregated to save space. The data is available in both TXT Plaintext and JSON format.

This is a JSON example for AS1234:

{
  "asn": 1234,
  "handle": "FORTUM",
  "description": "Fortum",
  "subnets": {
    "ipv4": [
      "132.171.0.0/16",
      "137.96.0.0/16",
      "193.110.32.0/21"
    ],
    "ipv6": [
      "2405:1800::/32"
    ]
  }
}

For a list of autonomous systems with their AS number (ASN) and description see ipverse-asn-info

This repository is updated daily.

Use cases

  • Firewalling, e.g. to ban all IP addresses from that notorious, Spam-friendly network provider
  • Route advertisment check, see if/how the routes of a specific autonomous system are seen (even over time, thanks to Git's changelog)
  • Statistical analysis purposes, e.g. the number of public IPv4 addresses currently announced vs unused/unassigned
  • OSINT/CTI Cyber Threat Intelligence

How to use

To download the announced networks for a specific autonomous system (AS1234 IPv4 adresses in this example), try:
$ curl https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1234/ipv4-aggregated.txt

The same for all IPv6 networks from AS1234:
$ curl https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1234/ipv6-aggregated.txt

The data (IPv4 + IPv6 combined) is available in JSON format as well:
$ curl https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1234/aggregated.json

To download the latest autonomous system list which is used enhance the generated route data:
$ curl -O https://raw.githubusercontent.com/ipverse/asn-info/master/as.csv

See ipverse-asn-info for more information on as.csv

If you plan to use the routing data for firewalling purposes, have a look at:

  • ipset-blacklistlist ipset/iptables based Bash script, IPv4 only
  • todo insert link to a popular project with nftables and IPv6 support

Yeah, but how do I get the ASN for an IP address?

Check out this excellent blog post: https://blog.jiayu.co/2018/10/quick-url-to-asn-lookups/