Search code examples
connectionipwifiexternalping

Is it possible to ping offline devices?


This may be a strange question but I really want to learn how "ping" command works. Today when I had my smartphone open and online, I pinged its external(public) IP from my terminal in Linux with "ping [ip address]" command and it worked of course. When I turned off my smartphone and retried to ping its IP, it worked again! As far as I know ping is like sending a message and then getting a reply from the target.How is this possible since my phone is offline? Any explanation is much appreciated! Thanks!

UPDATE: Both my phone and PC use Wifi to connect to the internet and are in the same network. Also there was not any other device that joined the network when I tried the above.


Solution

  • If you subscribe the service from an ISP, then you might share the use of one public IP address among your devices to connect to the Internet. Internally you'll use private IP addresses for your PC and phone. It seems to me that what you have pinged was the public IP address assigned on the gateway of your wifi router and not your phone. If you are not sure, then try to access http://whatismyipaddress.com/ from both your devices and see if you have the same IP address or not.