Why Androids keep disconnecting?

I am running a local file server that androids connect to get files. The problem here is that there is no internet and the androids disconnect all the time.
Apparently they try to connect to Google’s http://www.gstatic.com/generate_204 to check if there is internet. if they dont get a reply, they try to find another wifi that has internet.
How can i make my server generate that reply?

Any replies appreciated.

Hmm, did you see that yourself that it tried the gstatic.com domain ?
I’ve checked my Pihole that logs everything (and I block everything like DNS-over-TLS,DoH,Quic) and I cannot find any such lookup ?
Phone is a Samsung Galaxy S21

Hi. well, thats how i have read its going it…to find out that there is internet.
any ideas, appreciated. tried on various brands.

Take a look at below address. It will give you an idea.

https://www.ateijelo.com/blog/2016/09/11/make-android-believe-it-has-internet-access

Hi, thanks for this. this is actually what we need to do. anyone knows how to implement it with mikrotik?

As the “recipe” says, it doesn’t work any more since Android 7. And no, you can’t do it in “plain” ROS as it can’t do the fancy http stuff (like lighthttp does). If you ran a container with some more proper http server (lighthttp or nginx or apache or …), then you could do the described trick on MT device. But again, it doesn’t seem to be enough since Android 7 (and we’re now at 14 and heading for 15).