Determine if the IP address is a cellular IP address

In the .NET Compact Framework, a device can have multiple IP addresses; I want to find one that does NOT come from a cellular connection. The goal is a WiFi or Ethernet connection.

Is there any way to do this?

It seems that State and Notification Broker would have a way to do this, but didn't see a way.

+4
source share
2 answers

No, you have to do it manually.

Obviously, it’s not easy for you to know which IP addresses belong to the cell or not. The easiest way is to grab the ISP IP base from maxmind.com - http://www.maxmind.com/app/isp - which will give you the ISP name for any IP address (well, most IP addresses). Then you just tweak the regular expressions to match keywords like sprint, verizon wireless, cell, etc., to determine if this is a cell phone IP phone or not.

Not the most pleasant of funnest solution, but I do not know the best way.

+5
source

Each operator has a group of IP addresses. If you know the network address of the operator, you can compare the IP address of the visitor with the address of the operator.

So, for example, if you know that the mobile operator owns a group of ip addresses, starting from 212.235.*.*

you compare the first 16 bits of the visitor’s address with it, if, for example, the visitor’s address is 212.235.190.215, you know that he is coming from the mobile network.

You can check this condition with simple string operations - compare the first x characters of the guest ip address with the x known characters at the beginning of the operator's IP address.

0
source

Source: https://habr.com/ru/post/1306392/


All Articles