使用IPv6进行地理位置定位? [英] Geolocation with IPv6?

查看:832
本文介绍了使用IPv6进行地理位置定位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个IP地理位置库,该库使用IPv4地址的前三个八位位组来确定用户的国家/地区,城市,经纬度,经度等.

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.

但是它不处理IPv6地址,我希望这样做.

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

是否有任何方法可以转换IPv6地址以使其等同于IPv4地址的前三个八位位组,或者它们采用的是完全不同的编号方案,需要完全不同的ipgeo映射?

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?

推荐答案

典型的IPv6分配是Internet的/32(四个八位位组) 提供商(可以是跨国公司),然后/48(六个八位字节) 到最终站点(通常是客户组织).你可以得到一个 IANA委托块列表中的起点.

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.

这仅用于 在RIR数据库中找到的注册.结束分配 通常不会记录用户,因此,我当前的地址, 2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b只会告诉您我的 提供商的总部位于巴黎(因为它是一家国家公司, 客户可以在法国的任何地方.

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).

另一个例外是PI(与提供者无关)分配,该分配 通常是/48.

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

此外,还有许多用于IPv4的地理位置数据库,对于我来说, 知识,没有IPv6.您将必须自己做所有事情.

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.

这篇关于使用IPv6进行地理位置定位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆