Captive portal WiFi Hotspot error fixes

Travelers may rely on public WiFi, which typically has captive portal login. Portals force users to accept obnoxious terms and conditions and absolution of liability before accessing the Internet. To varying degrees, the portals may be worked around by savvy users, including to use VPN where the host wants to charge for using VPN. Most users just tolerate the portals.

Here’s how to understand and workaround some of the most common connectivity issues due to defective captive portals. I have found universally that telling companies their WiFi is broken and how to fix it gets sort of a quizzical response. Nonetheless, I still offer them free technical info in case it gets forwarded to their IT provider, which is unlikely to be in-house, or their network would actually work.

The following sections detail how to trigger captive portals in case they didn’t come up for you, perhaps in locales that block your expected captive portal trigger URI (for example, Google in mainland China). If one doesn’t work for you, try another–they all should work regardless of OS. Due to the rise of HSTS, just browsing your favorite website will not work, because it most likely has HTTPS and HSTS, which block HTTP captive portal redirects–this is one of the main purposes of HSTS.

We appreciate comments if you find changes or additions.

For those configuring network firewalls, the URIs below can change at any time.

Web browsers

Modern web browsers themselves try to trigger captive portals by checking servers, in case the OS hasn’t already triggered the captive portal.

  • Firefox: http://detectportal.firefox.com/success.txt
  • Chromium: http://clients3.google.com/generate_204

Mac OS

Mac OS X checks for response code 200 from http://captive.apple.com/hotspot-detect.html

Windows

Windows 7, 8, 10 check network connectivity by accessing http://www.msftncsi.com/ncsi.txt and looking for response code 200. Further refinements are used if full internet access is not detected.

Linux

The many variants of Linux including Fedora and Ubuntu check connectivity by looking for expected HTTP response codes such as 200 or 204.

Linux distro site HTTPS response code
Ubuntu http://connectivity-check.ubuntu.com 204
Fedora http://fedoraproject.org/static/hotspot.txt 200

You can check connectivity manually using curl by

curl -w %{http_code} http://connectivity-check.ubuntu.com

This should return on stdout 204. Other distros return codes as in the table above. Let me know in the comments if you see something different or to add another Linux/BSD distro.

Ubuntu

If you desire to disable connectivity checking in Ubuntu, this is done via: Settings → Privacy →“Network Connectivity Checking”

Android

Android checks Internet connectivity on new and existing connections by looking for response code 204 from http://connectivitycheck.gstatic.com/generate_204

Networks that block Google may show a heads-up message saying

Connected, no Internet

If there’s not a captive sign-in webpage, the network connection may actually be working to non-Google sites.

Categories: ,

Written by Michael Hirsch, Ph.D. //

Comments