ℕʘʘḆḽḘ
ℕʘʘḆḽḘ

Reputation: 19395

how to match IP addresses with ASN data (maxmind)?

I am looking at the data here https://dev.maxmind.com/geoip/geoip2/geolite2-asn-csv-database/

that contains, as explained:

  1. The IPv4 or IPv6 network in CIDR format such as “2.21.92.0/29” or “2001:4b0::/80”. We offer a utility to convert this column to start/end IPs or start/end integers. See the conversion utility section for details.

  2. The autonomous system number associated with the IP address.

  3. The organization associated with the registered autonomous system number for the IP address.

My question is: from a regular IPv4 address, how can I match with this data? Can I just match on all the numbers before the / (such as 1.0.0.0/24 ) ?

Thanks!

Upvotes: 0

Views: 1049

Answers (1)

Michael C.
Michael C.

Reputation: 1457

No, you should find the beginning and ending IP address of one IP CIDR range and then find it whether if the IP address number is matching in the range.

Upvotes: 1

Related Questions