2021-12-08 13:49:54 +01:00
# ipverse-rir-ip
2022-08-14 18:43:08 +02:00
Drop-in replacement for the network lists previously available at [ipverse.net ](http://ipverse.net )
2021-12-11 14:02:47 +01:00
based on Internet number resource usage data published by the Regional Internet Registries (RIR). The data
is organized by country code (ISO 3166).
2021-12-08 13:49:54 +01:00
2021-12-13 19:29:58 +01:00
This repository is updated daily (if the underlying data changes).
2021-12-08 13:49:54 +01:00
2022-12-18 15:15:51 +01:00
## Update notes
2022-12-18 15:23:21 +01:00
- 2022-12-18: Fixed prefixes for some delegated networks as reported by [RF3 ](https://github.com/RF3 ), see [this thread ](https://github.com/ipverse/feedback/discussions/9 ) for details
2022-12-18 15:15:51 +01:00
2021-12-08 13:49:54 +01:00
## How to use
2022-08-14 18:43:08 +02:00
To download the delegated IPv4 networks for Switzerland, try:
2021-12-08 13:49:54 +01:00
```$ curl https://raw.githubusercontent.com/ipverse/rir-ip/master/country/ch/ipv4-aggregated.txt```
2022-08-14 18:43:08 +02:00
To download the delegated IPv6 networks for Switzerland, try:
2021-12-08 14:38:18 +01:00
```$ curl https://raw.githubusercontent.com/ipverse/rir-ip/master/country/ch/ipv6-aggregated.txt```
2021-12-08 19:59:37 +01:00
The data (IPv4 + IPv6 combined) is available in JSON format as well:
2021-12-11 14:54:03 +01:00
```$ curl https://raw.githubusercontent.com/ipverse/rir-ip/master/country/ch/aggregated.json```
2021-12-08 16:36:43 +01:00
2021-12-08 16:38:26 +01:00
The resulting JSON will look similar to this:
2021-12-08 16:37:26 +01:00
```
{
2021-12-11 14:54:03 +01:00
"country": "Switzerland",
"country-code": "CH",
2021-12-08 16:51:05 +01:00
"delegation-status": [
2021-12-08 16:36:43 +01:00
"allocated",
"assigned"
],
"mode": "aggregated",
"subnets": {
"ipv4": [
"43.254.56.0/22",
"45.115.72.0/22",
"59.153.132.0/22",
],
"ipv6": [
"2001:df0:840::/48",
"2001:df7:f980::/48",
"2401:4b80::/32",
]
}
2021-12-08 16:37:26 +01:00
}
```
2021-12-11 14:49:16 +01:00
2022-02-20 10:18:37 +01:00
## Want moar IP addresses?
Instead of carpet banning an entire geographic region, it might be more effective to just ban specific internet providers based on their autonomous system number (ASN).
Check out the [ipverse-asn-ip ](https://github.com/ipverse/asn-ip ) repository for more information.
2021-12-11 14:49:16 +01:00
## Migrating from ipverse.net?
2022-02-20 10:18:37 +01:00
While all download URLs pointing to [ipverse.net ](http://ipverse.net ) are being redirected to the corresponding file in this Github repository, you may choose to directly download the data from the new location. Here's how to change the download-URL:
2021-12-11 14:49:16 +01:00
Old URL:
2021-12-11 14:50:34 +01:00
```http://ipverse.net/ipblocks/data/countries/ch.zone```
```http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone```
2021-12-11 14:49:16 +01:00
New URL:
2021-12-11 14:50:34 +01:00
```https://raw.githubusercontent.com/ipverse/rir-ip/master/country/ch/ipv4-aggregated.txt```
```https://raw.githubusercontent.com/ipverse/rir-ip/master/country/ch/ipv6-aggregated.txt```