Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IPv4 entries with /32 in de.zone #9

RF3 started this conversation in General
Dec 14, 2022 · 2 comments · 1 reply
Discussion options

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)

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

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

You must be logged in to vote
1 reply
Comment options

Thanks for the heads-up!

Comment options

This should be fixed now. Thanks again for pointing this out, this was a major f*** up.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /