Why Mobile IPs Break City-Level Geolocation
CGNAT, national gateways and carrier routing explain most bad city results. Here is how to design rules that survive mobile traffic.
# Why Mobile IPs Break City-Level Geolocation
More than half of consumer web traffic is mobile, and mobile is where naive geolocation rules fall apart.
Carrier-grade NAT
Carriers do not have enough IPv4 addresses for their subscribers, so thousands of devices share one public IP. That address lives at the carrier gateway, which is typically in a major city regardless of where the subscriber actually is. A user in a rural area routinely appears in the capital.
The practical consequences:
- City distance errors of hundreds of kilometres are normal, not a data bug.
- Rate limiting per IP punishes an entire neighbourhood of innocent users.
- Reputation scoring per IP is unfair; one abuser poisons a shared address.
Roaming and gateway anchoring
A roaming subscriber often keeps exiting through the home carrier network. A German phone in Italy can show up as German traffic all week. If your rule fires on country change, roaming users will trip it constantly.
IPv6 changes the picture
On IPv6 each device usually gets its own address from a /64 or /56 prefix. Rate limit on the /64, not the individual address, or a device rotating within its prefix defeats you instantly. Geolocation on IPv6 mobile is often better because there is less aggregation, but coverage of the prefixes varies by carrier.
Designing around it
- Use the connection type. When it is
mobile, downgrade city to advisory and rely on country. - Rate limit on account or device identity, not IP, for mobile networks.
- Never use city distance as a fraud signal on mobile traffic.
- Accept country changes for established accounts and step up authentication instead of denying.
Guarda returns the connection type on every lookup precisely so these branches are easy to write. The rule you want is not "where is this IP" but "how much should I trust the where".
