I have an offline arm device that works in AP mode for configuring etc. The only issue is when a phone, for example, connects to the wifi AP the phones 4g internet connection is cut off.

I suppose this is a DNS issue but I haven't been able to figure it out and can't find anything on the internet.

Any help would be appreciated! I've been stuck on this for months.

I'm running debian 9 with hostapd and dnsmasq.

Here is my dnsmasq.conf

#interface=wlan0                # Use interface wlan0
#listen-address=                  # Explicitly specify the address to listen on
#bind-interfaces                            # Bind to the interface to make sure we aren't sending                      things elsewhere
server=                          # Forward DNS requests to Google DNS
#domain-needed                              # Don't forward short names
#bogus-priv                             # Never forward addresses in the non-routed address spaces
  • 1
    So there’s no Internet connectivity in this Wi-Fi network...? Why set a DNS server at all then? – Daniel B Apr 17 '19 at 5:19
  • Nope, no internet. I want to capture urls like "device.mine" so users don't have to type in an IP address to access the websever on the arm device. – daniel654 Apr 22 '19 at 0:30

It seems that the issue doesn't matter with AP. The reason is that, when connected to WiFi, the iPhone funnels all requests through that Wifi connection to the ap. Now, some apps are programmed to switch to cellular if the connection times out, but this takes a not-insignificant amount of time.

But it's a feature pre built into Android.

In case you are using "Android Marshmallow" just head to the developer options and you will find the "Mobile data always active" toggle right there.

In case you don't have the developers option unlocked do the following.

Open settings on your device. Scroll down to about phone. Head to build number and tap seven times on it. That's all. reference link https://www.quora.com/Is-it-possible-to-use-mobile-data-while-being-connected-to-wifi

|improve this answer|||||
  • Thanks, but I don't have control over the user's devices. – daniel654 Apr 22 '19 at 0:31

Your configuration is missing a dhcp-option=3 line to specify that no default route is to be provided. I'd strongly suggest not providing DNS servers either and also specifying dhcp-option=6 to disable DNS. If you're not going to supply Internet access to devices, you shouldn't provide them a default route or DNS either -- otherwise how will they know that the connection isn't to the Internet?

|improve this answer|||||
  • Thanks @david, I will give your suggestion a try. I'm hoping to keep the DNS active so users don't have to type out an IP address to reach the webserver on my arm device. – daniel654 Apr 22 '19 at 0:36
  • I tried setting dhcp-option=3. It worked for my Linux PC but Android still won't let the cellular network through while connected to the wifi network. I will follow your advice and disable the DNS. How can I do this with hostapd? I tried setting dhcp-option=6 but that didn't work. – daniel654 Apr 22 '19 at 1:40
  • @daniel654 Android devices often require some specific setting to be enabled in order to use both WiFi and cellular networks at the same time. – David Schwartz Apr 22 '19 at 14:12
  • Thanks, unfortunate news for my use case! – daniel654 Apr 22 '19 at 22:16

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.