-
Notifications
You must be signed in to change notification settings - Fork 0
-
Today I downloaded the zone data for Germany from here: https://raw.githubusercontent.com/ipverse/rir-ip/master/country/de/ipv4-aggregated.txt
To my surprise, I found 73 entries ending on /32 which would only match a single address. For example:
134.98.184.0/32
But when I look at the raw data of RIPE NCC, the line looks like this:
ripencc|DE|ipv4|134.98.184.0|18432|20000724|assigned|990abedc-85ee-4e31-9905-2d6e24353cc3
As you can see, the netmask(s) should cover 18432 addresses (134.98.184.0 - 134.98.255.255) and not just a single one. So there should be two lines instead:
134.98.184.0/21 (134.98.184.0 - 134.98.191.255)
134.98.192.0/18 (134.98.192.0 - 134.98.255.255)
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Replies: 2 comments 1 reply
-
Here is a little awk script that I just wrote to convert the RIPE raw data into the correct x.x.x.x/y format:
BEGIN {
FS="|"
}
function IP2Value(ip, array)
{
split(ip, array, /\./)
return lshift(array[1], 24) + lshift(array[2], 16) + lshift(array[3], 8) + array[4]
}
function Value2IP(value)
{
return rshift(value, 24) "." and(rshift(value, 16), 255) "." and(rshift(value, 8), 255) "." and(value, 255)
}
# filter for DE zone and IPv4 entries:
2ドル == "DE" && 3ドル == "ipv4" {
value = IP2Value(4ドル)
count = 5ドル
for (i = 2; (i <= 30) && (count > 0); i++)
{
mask = 2 ^ i
if (and(count, mask))
{
printf("%s/%d\n", Value2IP(value), (32 - i))
value += mask
count -= mask
}
}
}
Save it to a file like convert-ripe.awk and use it like this with the downloaded raw data:
awk -f convert-ripe.awk < delegated-ripencc-extended-latest.txt
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thanks for the heads-up!
Beta Was this translation helpful? Give feedback.
All reactions
-
This should be fixed now. Thanks again for pointing this out, this was a major f*** up.
Beta Was this translation helpful? Give feedback.