our 'what is my ip address' tool getting weird public IP discrepancies for mobile users

Author
Valeria Martinez Author
|
3 weeks ago Asked
|
73 Views
|
2 Replies
0

hey folks, we've been running our what is my ip address tool for a while now, and generally, it's pretty solid. it's become a decent little public IP checker for our users. but lately, we're seeing some really strange behavior, especially for a subset of our mobile users.

the public IP address shown for them is often completely off, like, not even close to their actual location. this is leading to totally incorrect geo-location data, which is a real pain. oddly, this isn't happening for desktop users at all, only mobile. it's like their true IP is being masked or routed weirdly. hereโ€™s a dummy example of what we sometimes see in our logs:

User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
Reported IP: 104.28.232.121
Geo-Location (Reported IP): San Francisco, CA, USA
Expected Geo-Location (from user feedback): Berlin, Germany
ISP for Reported IP: Cloudflare, Inc.

is this a common issue with mobile networks, proxies, or specific carrier setups that might obscure the true public IP address? what's the best or most reliable way to get the actual user's IP when they're on a mobile network, especialy given how many things can proxy traffic now? we're looking for any insights or debugging tips you guys might have. thanks in advance!

2 Answers

0
MD Alamgir Hossain Nahid
Answered 3 weeks ago

Hey Valeria Martinez,

This is a common and often frustrating challenge when dealing with public IP address detection for mobile users. What you're observing isn't necessarily a fault with your "what is my IP address" tool itself, but rather a reflection of how modern mobile networks and various internet services handle traffic. The example you provided, showing a Cloudflare IP and an incorrect geo-location, is a classic symptom of traffic being routed through a proxy or VPN service.

Hereโ€™s why this happens and what to consider:

  1. Carrier-Grade NAT (CGNAT): Many mobile carriers use CGNAT. This means multiple mobile devices share a single public IP address. The IP your server sees might be that of the carrier's NAT gateway, which could be located anywhere geographically, not necessarily near the user. This makes accurate IP geo-location for mobile devices inherently less precise.
  2. VPNs and Proxy Services: Users might be intentionally using VPNs or privacy services (like Cloudflare WARP, which your example IP strongly suggests). These services route traffic through their own servers, effectively masking the user's true ISP-assigned IP. Your tool would then report the IP of the VPN/proxy server.
  3. Browser and App Proxies: Some mobile browsers (e.g., Opera Mini in "data savings" mode) and certain apps route traffic through their own compression or proxy servers to save data or improve performance. Again, your server sees the proxy's IP.

For your "what is my IP address" tool, the most accurate answer you can provide is the REMOTE_ADDR that your server sees. If the user is behind a VPN or a carrier proxy, that's the IP that represents their connection to your server. While you can look for headers like X-Forwarded-For or CF-Connecting-IP (if you're behind Cloudflare yourself), these headers can be spoofed or might also represent an upstream proxy, not the end-user's true public IP. There isn't a universally reliable way to "break through" these layers to get the absolute original IP without relying on client-side browser APIs (which require user consent and report geo-location, not IP location).

For more robust mobile IP detection and geo-targeting, especially for marketing purposes, you might need to accept the limitations of IP-based geo-location for mobile users and potentially combine it with other signals, like location data from browser APIs (if the user grants permission), or simply acknowledge that the reported IP is the egress point of their connection rather than their physical location.

Hope this helps your conversions!

0
Valeria Martinez
Answered 3 weeks ago

Okay, that explanation for CGNAT and the Cloudflare WARP stuff really clears up why we were seeing those strange mobile IP discrepancies. But it got me thinking, if multiple users are sharing an IP through CGNAT, how do analytics platforms even cope with tracking unique users? Like, is it just completely unreliable for identifying unique mobile users tho?

Your Answer

You must Log In to post an answer and earn reputation.