<h3>Background</h3>
<p>
You're running a firewall on your work and home networks right, so of course you're running one on your Smart Phone. Given this device holds more information about you than you probably know yourself, it would be only prudent to make sure that you are protecting what gets in but also what gets out.
</p>
<p>
I run <a href="https://f-droid.org/en/packages/dev.ukanth.ufirewall/">AFWall+</a> which is available from the <a href="https://f-droid.org/">F-Droid</a> app store. It runs fine on <a href="https://www.lineageos.org/">LineageOS</a>.
</p>
<p>
I then set it on the children's phone so that no application is allowed to use mobile data, and then only applications that need Internet get Internet Access. This works well as it's a normal use case for mobile applications to have intermittent access to the Internet.
</p>
<p>
I see no reason why the Linux Kernel should need unfettered access to the Internet, so it's not allowed out. One issue you may come across is that even though you know that there is a Connection your phone doesn't, and so it will display the <em>Wi-Fi Connected, no Internet</em> message. 
</p>
<p>
<img src="https://hackerpublicradio.org/eps/hpr2810_1.png" />
</p>
<p>
I'm not sure how this check is done but <a href="https://android.stackexchange.com/users/53535/abqnm">abqnm</a> suggests at in the StackExchange question <a href="https://android.stackexchange.com/questions/63481/how-does-android-determine-if-it-has-an-internet-connection">How does Android determine if it has an Internet connection?</a> that it may be related to Google Cloud Messaging.
</p>

<quote>
... this means that the device is unable to receive a response from GCM (Google Cloud Messaging, the framework that handles push notifications). This traffic is sent through ports 5228, 5229, and 5230. If the AP is blocking or interfering with traffic on those ports, push notifications won't work ... 
<quote>
<p>
I do indeed see blocked attempts by Google Play Services on my own phone, but not on the other phones that have no google services installed. The only entry I see in the logs is an ICMP attempt to "Comcast Cable Communications, Inc". If you know more please record a show for <a href="https://hackerpublicradio.org">Hacker Public Radio</a> about it.
</p>

<h3>Giving Access</h3>
<p>
Normally you will get a message saying that the Wi-Fi has no Internet access. 
</p>
<p>
<img alt="Android System. Wi-Fi has no Internet access. Tap for options" src="https://hackerpublicradio.org/eps/hpr2810_2.png" />
</p>
<p>
If you tap the message a popup will allow you to stay connected and will let you remember the choice.
</p>
<p>
<img alt="OpenWireless.Org. This network has no Internet access. Stay connected? [] Don't ask again for this network NO YES" src="https://hackerpublicradio.org/eps/hpr2810_3.png" />
</p>
<p>
In some cases the router helpfully resets the connection before you can reply to the message meaning it goes into a loop continually popping up the message but not reacting to it.
</p>
<p>
In this case we can use <a href="https://f-droid.org/en/packages/com.termux/">Termux</a> a Android Terminal emulator, to drop to a shell and fix the problem.
</p>
<p>
<img src="https://hackerpublicradio.org/eps/hpr2810_4.png" />
</p>

<p>
I used <em>su</em> to get root access but you could also change to the user <em>wifi</em>.
</p>
<p>
The file you need to edit is <strong>/data/misc/wifi/wpa_supplicant.conf</strong>. It's probably best to edit this file with the wifi off.
</p>
<pre>
network={
	ssid="OpenWireless.Org"
	key_mgmt=NONE
	priority=15
	id_str="{snip}"
}
</pre>
<p>
Scroll down to the network that is giving you trouble and add <strong>disabled=1</strong>
</p>
<pre>
network={
	ssid="OpenWireless.Org"
	key_mgmt=NONE
	priority=15
	disabled=1
	id_str="{snip}"
}
</pre>
<p>
I ended up copying the file to the sdcard, and editing it there. I then copied it back as su and used <strong>chown wifi:wifi /data/misc/wifi/wpa_supplicant.conf</strong> to fix the permissions.
</p>

<p>
Once that's done you can reboot the phone and connect to the network without a problem. You should also consider putting up an <a href="https://openwireless.org/">Open Wireless</a> access point yourself.
</p>
