WiFi access point without internet access - iOS devices disconnect
If it's possible, try to allow TCP traffic to apple.com and icloud.com. On my hotspot it prevents iPhone from thinking that it uses a hotspot. Hope it'll help you.
Tim Raasveld
Updated on September 18, 2022Comments
-
Tim Raasveld over 1 year
I'm trying to configure a WiFi access point to offer a web service on the local network, without offering clients internet access. The web server has a fixed IP address (let's say 192.168.2.2) and for user friendliness a local dns server assigns it the domain name
app.com
.However, when an iOS 8 iPad connects to the network, it automatically tries to determine whether the WiFi network is "usable" - meaning it provides internet. If it fails, the iPad disconnects automatically.
We found this answer suggesting setting the DHCP server(udhcpd in our case)'s DHCP gateway to 0.0.0.0 ("null") and using static DHCP configuration. However, we wish to use DHCP, and indeed clients are no longer automatically assigned an IP when we unset udhcpd's DHCP gateway(
router
option). This is the relevant section of ourudhcpd.conf
, in case it helps:start 192.168.2.100 end 192.168.2.149 max_leases 50 interface br0 remaining yes option subnet 255.255.255.0 #option router 192.168.2.1
So, is there a way to tell iOS devices to stay connected to a WiFi network while still using DHCP for client IP's, subnet and DNS configuration?
-
Tim Raasveld almost 9 yearsDid you provide no internet access as asked in the OP? If we have internet, everything works as you say, but if the internet is missing (i.e. WAN unplugged) iOS devices disconnect right after closing the WiFi popup (Actually, like you, we built a captive portal that uses the pop-up, but left that out for simplicity's sake)
-
ArchiT3K almost 9 yearsI did provide no internet access. I wanted the popup anyway. So to have the popup "hooking" the Wifi, I needed to open internet access for 2 seconds. It has been a work with
iptables
,dnsmasq
andphp
, neverdhcp
. Btw, how do you bypass the popup ? -
Tim Raasveld almost 9 yearsThanks for the clarity. Just tried it and it works, but our question is for a situation where (temporary) internet access is impossible. If you wish to bypass the popup, whitelist captive.apple.com (see andrey's answer) in your captive portal's HTTP proxy so the iOS devices will think it has internet access.
-
ArchiT3K almost 9 yearsThanks. I will have the same problem about "impossible internet access" and frankly I dont know yet how to manage this. I tried to mimic captive.apple.com response page (Success body) - in order to fool iOS - but it failed. Maybe I missed something, but I really copied full source from it. Note: I had to force popup display by my side, even with zero whitelisting, I didnt get the popup. I ll keep this for zero internet access mode and tell my clients to go Safari directly.
-
Tim Raasveld almost 9 yearsThe popup should always open when
captive.apple.com/library/test/success.html
shows something other than the Success page (but not nothing or an error status); this causes an automatic disconnect in my experience). Feel free to open another question if you need further help with this issue! -
ArchiT3K almost 9 years@TimRaasveld My popup does not open even when
captive.apple.com/library/test/success.html
returns my welcome page 'landing.php'. I had to include a wispr payload, into landing.php, to make it opening. -
ArchiT3K almost 9 yearswhich tool would you use to allow such traffic ? dnsmasq ?
-
andrey almost 9 yearsOne of possible solutions is to use dnsmasq, ipset and iptables. Probably there are others.