| as | ||
| .gitignore | ||
| LICENSE | ||
| MIGRATION.md | ||
| README.md | ||
as-ip-blocks (formerly asn-ip)
📢 New and improved: This repo has been upgraded with a clearer name (
as-ip-blocks) and enhanced JSON format. Check out MIGRATION.md for the quick changes needed (plaintext files are unchanged).
Daily-updated datasets about every autonomous system (AS), sourced from BGP routing table announcements. No APIs, no databases - just simple file downloads.
Each AS gets its own directory with aggregated IPv4 and IPv6 prefixes in both JSON and plaintext formats. Perfect for firewall rules, network analysis, or tracking what IP ranges belong to specific organizations. Git history lets you see how an AS's announcements change over time.
Available formats: JSON and plaintext
JSON format (includes both IPv4 and IPv6):
{
"asn": 1234,
"metadata": {
"handle": "FORTUM",
"description": "Fortum",
"origin": "authoritative",
"lastAnnounced": "2026-01-04T07:48:56.025859Z"
},
"prefixes": {
"ipv4": [
"132.171.0.0/16",
"137.96.0.0/16",
"193.110.32.0/21"
],
"ipv6": [
"2405:1800::/32"
]
}
}
Plaintext format (AS1234 IPv4):
# AS1234 (FORTUM)
# Fortum
#
132.171.0.0/16
137.96.0.0/16
193.110.32.0/21
Plaintext format (AS1234 IPv6):
# AS1234 (FORTUM)
# Fortum
#
2405:1800::/32
Metadata fields:
- origin: Metadata source indicator
authoritative: From authoritative sourceinferred: Inferred from routing information; may be inaccurateoverlaid: Metadata overlay from as-overlay appliednone: No metadata available
- lastAnnounced: ISO 8601 timestamp when the AS was last seen announcing prefixes (may be
nullfor older files)
For AS metadata (ASN, handle, description, country code) see as-metadata
Update notes
- 2026-01-03: Repository renamed to
as-ip-blocks, JSON format changed (subnets→prefixes, metadata nested). See MIGRATION.md for details. - 2025-08-03: Removed opinionated handle cleanup
- 2023-09-03: Removed PEM certificates from description field
How to use
Download the announced prefixes for a specific autonomous system:
AS1234 in JSON format:
curl https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1234/aggregated.json
AS1234 IPv4 addresses:
curl https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1234/ipv4-aggregated.txt
AS1234 IPv6 addresses:
curl https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1234/ipv6-aggregated.txt
For AS metadata (ASN, handle, description, country code), see as-metadata.
Firewall integration
If you plan to use the routing data for firewalling purposes, have a look at:
- ipset-blacklist - ipset/iptables based Bash script, IPv4 only
- ipverse-tools-crowdsec - Ban prefixes using Crowdsec's
csclicommand
How do I get the ASN for an IP address?
Check out this blog post: https://blog.jiayu.co/2018/10/quick-url-to-asn-lookups/
Use cases
- Block entire AS at the firewall (goodbye spam-friendly hosting providers)
- Check what routes an AS is announcing (Git history lets you track changes over time)
- Network research and statistical analysis
- Threat hunting and security research
- Figure out which IPs belong to a specific organization
- Pretty much anything where you need to map ASNs to their announced prefixes
Related projects
- as-overlay: Autonomous system metadata overlays that supplement and enhance the authoritative data in this repository. When overlay data is applied, entries will have an
originvalue ofoverlaidin the JSON format.
Questions or issues?
Head over to the feedback repository if you have questions, issues, or suggestions.
License
This data is released under CC0 1.0 Universal.