-5

I am thinking of creating an app that only allows users connected via a cell tower. Are there IP ranges that are only used by cell towers?

I realize that it may be a 'moving target', but does anyone know of a list of the current blocks (like black lists for spammers).

I do not want to rely on headers as they can be spoofed. IP address seems to be the only true way of identifying the client is on a cell network via IP.

  • 4
    How addresses are assigned by an organization is up to that organization. Say you figure out it out today, it could be different tomorrow. – Zoredache Jun 07 '12 at 18:43
  • 2
    Seriously, telling people to use "secure networks" because you don't want to properly encrypt communication sounds plain wrong to me. – thejh Jun 07 '12 at 19:32

3 Answers3

3

Which address? The address assigned to a phone or {3,4}G modem can be an RFC 1918 address, an unused public address, or even an IPv6 address which is proxied to v4. These typically sit behind some sort of NAT or proxy device so if you're checking the address from the server end you might be able to use a simple reverse DNS lookup or an ISP database.

To complicate matters further a lot of devices (e.g. my wife's phone) can act as an access point including another NAT layer. What happens when she tethers her iPad to her phone via 3G?

Gerald Combs
  • 6,441
  • 25
  • 35
2

There's no such thing as "cell tower IP ranges," especially since that cell tower could be on any provider, on any tower, or even WiFi in some cases. The point is, you should never NEED to rely on this information.

If you want to display a mobile version of the site to visitors, parse the user agent string to figure this out. If a user spoofs their information and views a non-mobile friendly version, then that user is a power user and can do whatever he or she wants. Otherwise, there is zero reason to restrict anything based on their IP.

Andrew M.
  • 11,182
  • 2
  • 35
  • 29
1

Yes, but you'd have to identify the netblock for every cellular provider you wish you allow. A better way would be to code your phone application to detect for data connectivity without a WiFi AP being associated.