0

This is pertaining to a smart phone with data.

My phone is connected to my WIFI which lacks internet currently. It is also connected to the cell network and using it for data. When I ifconfig it tells me I am connected on wlan with 192.168.1.4 and rmnet at 10.124.121.12. I am trying to ping a device on 192.168.1.55 for purposes.

If I turn off my cell network I can ping it fine. With my cell network on its unreachable.

How do I get my android to allow me to ping 192.168.1.55 while being on the cell network? I have only noticed this since the internet went out on my WIFI so its a strange and new problem.

  • That's expected. You won't be able to ping 55 from 4, but can do opposite. The reason is that Android can connect either to Wi-Fi or mobile data, which one has internet connectivity, if given option. If both are online, WiFi is preferred. It's because default route is set to mobile data (rmnet_data) interface. You can modify routing table manually if you have root access. – Irfan Latif Jul 1 at 7:50
0

I have the same setup. I have a local WiFi network that is not connected to the internet. I found that if you go to settings on your phone, then select “Developer options” and tick “Cellular data always active” that you will have access to the WiFi network and the cell network simultaneously.

On my LG, I can be on the web with cell data and print to the printer on the local WiFi network. I just now tested a ping just to make sure and it works just as you would expect.

  • I am fully rooted so I will try this out when the internet dies again, its about time for it. I have seen the option but did not try it. I'll let you know how it works. – Adtopkek Jul 1 at 22:06
  • This seemed to work fine for the rare instance that my internet goes out. Upvoted both of you but not enough Reputation for it to apply yet it seems. – Adtopkek Jul 6 at 2:37
0

you cannot ping that device via Mobile Data. You have Device 1 (yours) and Device 2 (device to be pinged). Telling from the IPs given, both devices are on the same WiFi network. Device 1 can connect to Device 2 by requesting a ping to Device 2 on your router (Device 3).

Your router is most likely having the IP 192.168.1.1

As your router knows that you are connected to it, it will forward your ping request to Device 2 and back again.

When connected to your mobile carrier, you have a different IP. But, your router uses IPs to determine whether it knows a device or not. As you have a different IP and your ping request comes from the outside now, it does it's job: Not forwarding your ping requests. That's what the router is there for (besides establishing connections). It is a firewall and it's trying to prevent people from outside harming your devices.

When you are connected to WiFi When connected to WiFi

When you are connected to Mobile Service Data Provider When connected over cellular data

This means, that you are not actually having an Android Problem. What you need to do is to tell your router to forward PING packets. That's difficult. For that, you should head over to the Servers Fault community and ask them how you can do exactly that.

https://serverfault.com/

  • I've always just assumed it was connected to both networks at once and it chose a preferred path but I could force it to a certain network by using that network's IP. That does make a few ideas I had more difficult. – Adtopkek Jul 1 at 22:10
  • Yes, it kind of is connected to both. You can still receive phone calls when you are connected to WiFi, right? ;) So, you have two options: Tell your phone to send ping requests to your router while using mobile data for everything else, or enable forwarding for ping packets. – ULTRACOMFY Jul 2 at 6:16
  • But your question asked for "how can I ping device 2 whilst connected to mobile data?", that's what I answered :) – ULTRACOMFY Jul 2 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.