Prevent Wifi AP from Blocking 3g/4g Internet

0

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=172.24.1.1                  # Explicitly specify the address to listen on
#bind-interfaces                            # Bind to the interface to make sure we aren't sending                      things elsewhere
addn-hosts=/etc/hosts
server=8.8.8.8                          # Forward DNS requests to Google DNS
server=8.8.4.4
server=208.67.220.220
#port=0
#domain-needed                              # Don't forward short names
#bogus-priv                             # Never forward addresses in the non-routed address spaces
dhcp-range=172.24.1.50,172.24.1.150,12h

daniel654

Posted 2019-04-17T05:03:29.047

Reputation: 3

1So there’s no Internet connectivity in this Wi-Fi network...? Why set a DNS server at all then? – Daniel B – 2019-04-17T05:19:14.657

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 – 2019-04-22T00:30:30.643

Answers

0

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

qi SONG

Posted 2019-04-17T05:03:29.047

Reputation: 214

Thanks, but I don't have control over the user's devices. – daniel654 – 2019-04-22T00:31:31.607

0

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?

David Schwartz

Posted 2019-04-17T05:03:29.047

Reputation: 58 310

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 – 2019-04-22T00:36:02.110

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 – 2019-04-22T01:40:20.217

@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 – 2019-04-22T14:12:49.277

Thanks, unfortunate news for my use case! – daniel654 – 2019-04-22T22:16:11.003