Why is 'What is my IP' tool showing inconsistent IP address lookup for mobile users?

Author
Benjamin Davis Author
|
19 hours ago Asked
|
4 Views
|
0 Replies
0

hey everyone,

i've been running a simple 'what is my IP address' web tool for a while now, and it generally works fine for most users. it's pretty straightforward, just tells you your current public IP address.

lately, i'm getting really inconsistent IP address lookup results, especially for users accessing the tool via mobile data networks (LTE/5G). sometimes it shows a generic carrier proxy IP, other times the IP changes on refresh, or it's just completely different from what other IP lookup sites show for the same device. it's not reliably displaying the actual public IP address for these mobile users, and it's driving me a bit crazy.

what i've tried so far:

  • checked server access logs for X-Forwarded-For headers, but they're often missing or unreliable from certain mobile carriers.
  • tested various third-party IP detection APIs (like ipinfo.io, ip-api.com) โ€“ some show similar inconsistencies, others are more accurate, but i'd prefer to rely on my own detection logic for the core functionality.
  • experimented with different server configurations (Nginx vs. Apache) to see if proxy handling was the issue, but no consistent improvement.
  • tested extensively on multiple mobile networks and devices across different regions, and the pattern persists.

i'm expecting to capture the direct public IP address of the mobile device's network gateway, but i frequently receive a different, often internal-looking or a very generic carrier-assigned IP. it's like my tool is hitting a mobile carrier's internal network before it reaches the actual internet.

here's a dummy example of what i see versus what an external service might report for the same mobile connection:

# My tool's server logs for a mobile user (e.g., AT&T 5G)
REMOTE_ADDR: 10.123.45.67  # Internal-looking or generic carrier IP
HTTP_X_FORWARDED_FOR: (empty or malformed)
USER_AGENT: Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1

# What ipinfo.io (or similar) would report for the same device/connection
IP: 172.217.10.14  # Actual public IP
ISP: AT&T Mobility LLC
ASN: AS7018 AT&T Services, Inc.

any insights on why this happens specifically with mobile data? is it common carrier-specific NAT, aggressive proxying, or something fundamental i'm missing in my server-side IP detection logic for mobile traffic? it's really important for the accuracy of my 'what is my IP address' tool.

thanks in advance!

help a brother out please...

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

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