My phone (Google Pixel 6 and Android 15) is connected to both 4G and a Wifi network with no Internet. The wifi network gives me IP address 192.168.4.2 and I know there's a WIFI Access point on 192.168.4.1. The 4G network gives me IP address 10.96.106.X.
When I am connected to both networks I go to Termux and I try:
ping 192.168.4.1
but ping is unsuccessful - all the packets time out. Then I disconnect the 4G and I try again:
ping 192.168.4.1
And then the ping is successful. It seems like Android is thinking "The only way to perform the ping is go through the 4G network because your Wifi doesn't have internet", so it does the ping over the 4G network and hence it is unsuccessful. But that's wrong - I'm trying to ping an internal IP address on the wifi network so it should do the ping successfully. Any suggestions?