Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geolocation with IPv6?

Tags:

I'm working on an IP geolocation library that uses the first three octets of an IPv4 address to determine a user's country, city, lat, lon, etc. Works like a charm.

But it doesn't handle IPv6 addresses, and I'd like it to do so.

Is there any way to transform an IPv6 address to get the equivalent of the first three octets of an IPv4 address, or are they on an entirely different numbering scheme, requiring a completely different ipgeo mapping?

like image 261
benjismith Avatar asked Jul 22 '09 01:07

benjismith


People also ask

Does IPv6 have geolocation?

Yes, IPv6 geoloaction is supported as well.

Is IPv6 geolocation accurate?

The researchers tested various geolocation database downloads for the accuracy of their country-level geolocation data and found that compared to IPv4 addresses that are 90% accurate at the country level, IPv6 addresses are only 40–60% accurate.

Can police track IPv6?

FBI, Drug Enforcement Administration, and Royal Canadian Mounted Police officials have told industry representatives that IPv6 traceability is necessary to identify people suspected of crimes. The FBI has even suggested that a new law may be necessary if the private sector doesn't do enough voluntarily.


2 Answers

The typical IPv6 allocation is a /32 (four octets) to an Internet provider (which can be a multinational company), then /48 (six octets) to an end site (typically a client organization). You can get a starting point in the IANA list of delegated blocks.

This is only for registrations found in the databases of the RIR. Assignment to end users is typically not recorded so, my current address, 2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b will tell you only that my provider's headquarters are in Paris (since it is a national company, the clients can be anywhere in France).

Another exception is the PI (Provider-Independent) assignements, which are typically /48.

Also, there exists many databases of geolocation for IPv4 and, to my knowledge, none for IPv6. You will have to do everything yourself.

To summary: more work than you apparently believe.

like image 126
bortzmeyer Avatar answered Oct 18 '22 23:10

bortzmeyer


Friendly correction to Noah's comment (Jun 3 at 7:57)--

Per MaxMind's client services department (emphasis mine): "IPv6 is currently NOT supported. At some time in the future, we do plan to implement it but we do not have a date at this time."

like image 20
cjo30080 Avatar answered Oct 19 '22 00:10

cjo30080