简体   繁体   English

Google App Engine 上的 IPv6 到 IPv4

[英]IPv6 to IPv4 on Google App Engine

We are using a service that require us to provide an IP in V4 format.我们使用的服务要求我们提供 V4 格式的 IP。 Our application which resides on GAE reports (using python's os.environ["REMOTE_ADDR"]) for some users the IP in V6 format.我们驻留在 GAE 上的应用程序报告(使用 python 的 os.environ["REMOTE_ADDR"])为一些用户提供 V6 格式的 IP。 Is there away to convert the IP from V6 to V4 on GAE?是否可以将 IP 在 GAE 上从 V6 转换为 V4? Does GAE support the 6to4 transition mechanism? GAE 是否支持6to4转换机制?

Thanks, Eden谢谢,伊甸园


Update: While there is no way to convert IPv6 to IPv4 there is away to limit the access to the application to only those with IPv4.更新:虽然无法将 IPv6 转换为 IPv4,但可以将对应用程序的访问限制为仅具有 IPv4 的应用程序。 Which is an acceptable solution in my case.就我而言,这是一个可以接受的解决方案。 See: GAE IPv6 hosting请参阅: GAE IPv6 托管

6to4 is a deprecated method to provide IPv6 to.networks that only have an IPv4 uplink. 6to4 是一种向只有 IPv4 上行链路的网络提供 IPv6 的已弃用方法。 I don't think it is relevant to your question.我认为这与您的问题无关。

The very short answer: The whole world is slowly starting to enable IPv6, and Google is one of the companies that is actively working on IPv6 support.非常简短的回答:全世界都在慢慢开始启用 IPv6,Google 是积极致力于 IPv6 支持的公司之一。 You will have to deal with IPv6 support.您将不得不处理 IPv6 支持。

A bit longer answer: IPv6 is a different protocol than IPv4.更长一点的答案:IPv6 是与 IPv4 不同的协议。 You cannot 'convert' IPv6 addresses to IPv4 addresses.您不能将 IPv6 地址“转换”为 IPv4 地址。 IPv4 addresses and IPv6 addresses are unrelated. IPv4 地址和 IPv6 地址无关。 If your application cannot deal with IPv6 then your best bet is probably to overwrite os.environ["REMOTE_ADDR"] with a 'fake' IPv4 address when you detect an IPv6 address.如果您的应用程序无法处理 IPv6,那么您最好的选择可能是在检测到 IPv6 地址时用“假”IPv4 地址覆盖 os.environ["REMOTE_ADDR"]。

If you choose something that is never supposed to show up on the inte.net like 192.0.2.0 then you can later easily see which entries are caused by an IPv6 client.如果你选择了一些不应该出现在 inte.net 上的东西,比如 192.0.2.0 那么你以后可以很容易地看到哪些条目是由 IPv6 客户端引起的。 You won't be able to identify the client anymore though, as the 128 bits in an IPv6 address can never be put into a fake IPv4 address.但是,您将无法再识别客户端,因为 IPv6 地址中的 128 位永远无法放入伪造的 IPv4 地址中。 You really should adjust your application to deal properly with IPv6 if IP addresses are important to you...如果 IP 地址对你很重要,你真的应该调整你的应用程序以正确处理 IPv6 ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 GORM 在 postgresql 中存储 ipv4 和 ipv6 地址 - How to store ipv4 and ipv6 addresses in postgresql using GORM GCP 计算引擎 terraform 无外部 ipv4 - GCP Compute engine terraform no external ipv4 如何在 Google Cloud 服务上找到 IPv4 地址? - How do I find the IPv4 address on a Google Cloud service? Su.net IPv4 网段 - Subnet IPv4 CIDR Block 无法为 Google Cloud VM 的 IPv6 地址设置 PTR 记录 - Can't set PTR record for IPv6 address for Google Cloud VM 无法在 Google Cloud 中创建双堆栈 VM - 此网络接口不支持 IPv6 访问配置 - Unable to create a dual stack VM in Google Cloud - IPv6 access config is not supported for this network interface 如何从 IPV6 地址连接到 GCP(谷歌云平台)云 SQL 实例? - How to connect to a GCP (Google Cloud Platform) Cloud SQL instance from an IPV6 address? 如何更改为双栈子网并更新 VM 实例栈类型 - Google 云 - IPv6 支持 - How to change to dualstack subnet and update a VM Instance stacktype - Google cloud - IPv6 support 如何确定 AWS 中的 su.net IPv4 CIDR 地址 - How to determine subnet IPv4 CIDR address in AWS 如何在 GCP 中将 curl 设为转发规则的 IPv6 地址? - How to curl an IPv6 address of a forwarding rule in GCP?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM