IP addresses | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

IP addresses

Whenever i turn on my mobile data , and i get IP addresses by calling NetworkInterfaces.getNetworkIntetfaces.... i get some IP addresses that there is one non-private IP of range A. but if i search "my IP address"in Google it gives me another non-private ip address of range A. can you explain why they are different?

23rd Nov 2021, 4:24 PM
Mehran
Mehran - avatar
4 Answers
+ 2
If you search your ip on google it will give the address that you get from your isp (if connected to a home network or something). Mobile data has it's own cell towers that you communicate with to be on your mobile data carriers network, giving the ip you get from them. You can only reach public addresses unless you are inside of the network.
23rd Nov 2021, 8:36 PM
Slick
Slick - avatar
+ 2
If you can, could you message me the address? You don't have to, it'd just help a bit with the troubleshooting
23rd Nov 2021, 8:53 PM
Slick
Slick - avatar
+ 1
Slick thanks i used mobile data in both tests. and i still can't get why they are different. if the ip address that Google gives me is the main address that isp gives my mobile, so what's the first ip address that i got from calling that java method?
23rd Nov 2021, 8:51 PM
Mehran
Mehran - avatar
+ 1
Slick i have sent to you in the private messages
24th Nov 2021, 1:37 PM
Mehran
Mehran - avatar