Pretending to have internet to an Android tablet

Hello,

I have a demo kit for a piece of network connected hardware*, the plan was to have the device, a travel router, and an Android tablet, then we can connect anywhere whether or not there is internet.

The router is awesome, everything works. However the Lenovo Android tablet is trying to be too clever. If router has internet it is fine, if it doesn't then the tablet keeps disconnecting to try to find a network with internet. I have specifically told it to not do this, it also only knows one network. (Yes, I am moaning to Lenovo support about this).

An idea: Can the router lie to the tablet and pretend to have internet?

This may sound like a stupid thing to do (but stupid problems sometimes have stupid solutions). I don't need the internet, I just need the Android network settings to think there is internet. I just have no idea how routers communicate to devices that they have internet, or how devices check for connectivity.

Any ideas or suggestions would be most welcome. Thank you!

*If anyone is interested it is an Open-Source microscope called the OpenFlexure Microscope

AFAIK, the OpenFlexure microscope detects a valid internet connection by sending an HTTP request to http://example.com and checking for a 200 OK response.

https://superuser.com/questions/277923/how-does-windows-know-whether-it-has-internet-access-or-if-a-wi-fi-connection-re

Basically it tests for a reply. Reroute the query to local resources on router.

Some tablets like Amazon are tricky so you'd have to Wireshark it.

Thanks @j0rn and @mortneff. So I need to find a way to interrupt and send beck a a local resource. The OpenFlexure Microscope is fine, we control that OS ourselves and it is happy. I see that Windows requests "http://www.msftncsi.com/ncsi.txt", do you know what URL an Android tablet is requesting, and whether it is manufacturer specific?

Take hosts file entry to send name to an IP. A tiny server could reply.
You'd have to know what address that tablet is testing. Wireshark should show

1 Like

Looks up what wireshark is.

OK, I see what you mean now, and that you said it in your last reply! When I get a chance I'll have a go. Thanks!

1 Like

Is this a Windows tablet? Dohhh, you said android.

An idea.

"solved it by turning dhcp off and setting DNS to 0.0.0.0 forcing the network to not try connecting to the internet, "

1 Like

Android 14. Interestingly my phone which is also Android 14 is fine with staying connected. But the phone is Samsung, and the tablet is Lenovo. So it is Lenovo specific, and it is a bug because it ignores the "stay connected without internet" option I selected.

It seems to stay connected if I set a static IP not DHCP. I had tried this before and failed, but it didn't work. Turns out it didn't because I had typed in an IP on the wrong subnet due to fat fingers.

https://www.reddit.com/r/GooglePixel/comments/bs57yw/staying_connected_to_a_wifi_network_with_no/

Dns 0.0.0.0

1 Like

It seems to be staying connected if I am on static IP whether the DNS is set to 0.0.0.0 or to 8.8.8.8. So :crossed_fingers:.

8.8.8.8 is nicer because at least if I am in range of a network I can put the router into Repeater, and then show other things on the tablet during demos. Like cool interactive stitched microscope images

Normally an Android device will give a message like 'This WiFi does not have Internet Access, stay connected?" or similar when you first connect to a WiFi SSID wth no internet. There you can tell it to stay connected even though there's no Internet.

As mentioned above. It does have that option, but it ignores what I select which is the bug I am working around.

Well, I guess it's less of an router issue, but more of the tablet. There are two components in my experience which cause the issue: how the vendor implemented the DNS server options and the reliance on captive portal.

Normally a Android device is using by default the Google DNS, except you private your own one. Some vendors (for example Amazon [FU]) don't allow to override that setting and add just the custom DNS (for example provided by your router) as a second DNS-Entry, to deal with multiple requests.

At the same time, there are background requests to a captive portal, which is essentially just a check of the device if it's still online.

However, I don't know you device by heart, but what you could do is: add the DNS-Server by assigning the Wifi-Settings in the Tablet manually (for older Android versions) or use the private DNS Section (newer versions).

To turn off or providing an alternative captive portal, you have to activate Developer mode on the device and use ADB-Tools/Terminal.

I hope this helps you to find a proper solution

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.