Network IP range checking
IP range conversion
We need to be able to check for IP ranges
how long is this range? We have an iterator, so we need we need to make it a list to see what's inside it.
This is a list of networks, and the
/32 basically means this an single IP address, not a range full of entries. We can check this by looking at the first entry in the list.
And then sanity checking with
We represent IP ranges as actual numbers in the database, and we can see what number is it by converting the IP address into an integer with
We have an IP range that begins and ends with 22.214.171.124, which we now know 2604171263.
The IP range 126.96.36.199 is showing as between them. What does that work out to be?
OK, 2672107453 is definitely not between 2604171263 and 2604171263.
This looks like bug in our code that checks if an IP is within the IP we think it is.