Skip to main content

Apple CNA, Android Connectivity Check, Microsoft NCSI: Come funziona realmente il rilevamento del Captive Portal

Questo riferimento tecnico definitivo spiega come Apple CNA, Android connectivitycheck e Microsoft NCSI rilevano i captive portal. Fornisce indicazioni pratiche per i responsabili IT e gli architetti di rete sulla configurazione del walled garden, sulle modalità di errore comuni e sulle migliori pratiche per una distribuzione senza interruzioni.

📖 5 min di lettura📝 1,178 parole🔧 2 esempi3 domande📚 8 termini chiave

🎧 Ascolta questa guida

Visualizza trascrizione
Apple CNA, Android Connectivity Check, Microsoft NCSI: How Captive Portal Detection Actually Works A Purple WiFi Technical Briefing --- INTRODUCTION AND CONTEXT — approximately 1 minute Welcome to the Purple Technical Briefing series. I'm your host, and today we're getting into something that sits at the very heart of every guest WiFi deployment — captive portal detection. Specifically, we're looking at how Apple, Android, and Windows each decide, the moment a device joins your network, whether a captive portal is present and whether they should show it to the user. This matters enormously in practice. Get it wrong, and your guests connect to the network but never see the splash page. Or they see it twice. Or Windows loops endlessly on the sign-in prompt. These are real, recurring support tickets across hotels, stadiums, retail chains, and conference centres. And the root cause, almost every time, is a misconfigured walled garden or a misunderstanding of how these three OS families actually behave differently from one another. So let's get into it. --- TECHNICAL DEEP-DIVE — approximately 5 minutes Let's start with Apple, because Apple's Captive Network Assistant — the CNA — is probably the most widely discussed and the most frequently misunderstood. When an Apple device, whether that's an iPhone, iPad, or Mac, joins a new WiFi network, the operating system immediately fires off an HTTP GET request. On modern iOS and macOS, that probe goes to captive.apple.com, specifically the path /hotspot-detect.html. The device is expecting a very specific response: an HTTP 200 with a body that reads, verbatim, "Success" wrapped in basic HTML tags. If it gets that exact response, the OS concludes it has full internet access and does nothing further. No portal, no pop-up. But if the response is anything other than that — a redirect, a different body, a timeout — the CNA kicks in. It opens what Apple calls WebSheet, which is a sandboxed mini-browser. Not Safari. Not Chrome. A locked-down browser window that has no access to Safari extensions, cannot save passwords, and on macOS is fixed at roughly 900 pixels wide. This is important for portal designers: your splash page must render correctly in that constrained environment. Now here's the first critical nuance. The CNA probe is HTTP, not HTTPS. If your captive portal gateway intercepts that probe and redirects it to an HTTPS URL, the CNA will not handle it gracefully. The user will see a certificate warning, or the portal simply won't open. Your redirect must stay on HTTP port 80 for the initial probe interception. The second nuance: if your walled garden passthrough list includes captive.apple.com and allows it to reach the real Apple server, the device will get the genuine "Success" response, conclude it has internet, and never show the portal. This is a classic misconfiguration — operators add captive.apple.com to their passthrough list thinking they're helping, but they're actually bypassing their own portal. Apple has also been rolling out support for RFC 8910, the Captive Portal API, which uses DHCP option 114 to signal portal presence positively rather than relying on probe interception. iOS 16 and later support this. It's a cleaner mechanism, but it requires your DHCP server or access point to advertise the option — something most legacy deployments don't yet do. Now let's move to Android. Android's connectivity check works on a fundamentally different principle. Instead of expecting a specific body text in an HTTP 200 response, Android expects an HTTP 204 — that's 204 No Content. The primary probe URL is connectivitycheck.gstatic.com/generate_204. Secondary probes go to clients2.google.com/generate_204 and connectivitycheck.android.com. When Android fires that probe and receives a 204, it concludes: internet is available, no portal. When it receives anything else — a redirect, a 200 with content, a timeout — it flags the network as requiring sign-in and shows the user a notification: "Sign in to WiFi network." Tapping that notification opens the full Chrome browser, not a sandboxed mini-browser. This is a significant difference from Apple. Android users get the full browser experience, which means your portal can use JavaScript, cookies, and modern CSS without the constraints of CNA's WebSheet. The critical walled garden implication for Android: if you block connectivitycheck.gstatic.com entirely — don't allow it through at all — Android doesn't detect a captive portal. Instead, it shows "Connected, no internet." The user sees the WiFi icon with an exclamation mark and has no idea a portal exists. You must allow the probe URL through your walled garden but intercept it with a redirect rather than blocking it outright. Android 11 introduced support for RFC 7710 bis and the Captive Portal API via DHCP option 114, mirroring Apple's approach. If the DHCP handshake includes the API URL, Android fetches it immediately and prompts the user to log in. This is more reliable than probe interception, but again requires infrastructure support. Now, Windows. And this is where things get interesting, because Windows uses a dual-probe mechanism that trips up a lot of deployments. Windows Network Connectivity Status Indicator — NCSI — runs two checks simultaneously when a device joins a network. First, an HTTP probe: GET request to http://www.msftconnecttest.com/connecttest.txt, expecting a 200 response with the body text "Microsoft Connect Test". Second, a DNS probe: it resolves dns.msftncsi.com and expects a specific IPv6 address in response — fd3e:4f5a:5b81::1. If the HTTP probe is redirected, Windows detects a captive portal and opens the default browser — Edge, in modern deployments — pointing it at the portal URL. This part works fine. The problem is what happens after authentication. Here's the Windows looping scenario, which I see in support tickets regularly. User authenticates on the portal. The portal marks their MAC address as authorised. But Windows then re-runs its NCSI probes. If msftconnecttest.com is still being intercepted — perhaps because the gateway hasn't yet propagated the MAC authorisation — Windows concludes the portal is still active and opens the browser again. The user has to sign in a second time, or sometimes a third. This loop continues until the gateway correctly passes NCSI traffic for that client. The fix is straightforward but requires attention: ensure your gateway propagates MAC authorisation immediately and that post-auth traffic to msftconnecttest.com and dns.msftncsi.com passes through cleanly. Also worth noting: older Windows versions used www.msftncsi.com rather than msftconnecttest.com. If you're supporting Windows 7 or 8 clients — yes, they still exist in enterprise and public-sector environments — you need both domains in your walled garden. --- IMPLEMENTATION RECOMMENDATIONS AND PITFALLS — approximately 2 minutes Let me give you the practical implementation framework. Your walled garden — the list of hosts accessible before authentication — must cover all three OS probe sets. At minimum, that means: captive.apple.com and www.apple.com for Apple; connectivitycheck.gstatic.com, clients2.google.com, and connectivitycheck.android.com for Android; and www.msftconnecttest.com, dns.msftncsi.com, and www.msftncsi.com for Windows. Do not allow these hosts to reach their real destinations. Allow the DNS resolution to succeed, but intercept the HTTP traffic and redirect it to your portal. The distinction matters: DNS must resolve, HTTP must redirect. For the portal itself, always serve the initial redirect on HTTP port 80. Your portal login page can be HTTPS — and should be, for credential security — but the initial interception and redirect must happen over HTTP. Apple's CNA will not follow an HTTPS redirect. Test with all three OS families before go-live. The most common gap I see is teams testing on their own iPhones and declaring the portal working, without ever checking Windows or Android. A quick test matrix: iPhone on iOS 16+, Android on a stock Google device, and a Windows 10 or 11 laptop. Run each one, check that the portal appears, complete authentication, and verify the device shows full internet connectivity afterwards. If you're running a Purple WiFi deployment, the platform handles walled garden configuration automatically and maintains an updated host list as Apple, Google, and Microsoft update their probe endpoints. This matters because these URLs do change — Google has updated its probe URLs across Android versions, and Microsoft shifted from msftncsi.com to msftconnecttest.com in Windows 10. --- RAPID-FIRE Q AND A — approximately 1 minute Question: My Apple users see the portal on first connect but not on reconnect. Why? Answer: iOS caches the captive portal state per SSID. Once authenticated, the device remembers that network as "internet available." If you want to re-prompt on reconnect, you need to clear the MAC authorisation on your gateway, which forces the device to re-probe. Some venues do this on a timer — say, 24 hours — for daily re-authentication. Question: Android shows "Connected, no internet" even though the portal is working for Apple users. What's wrong? Answer: Your walled garden is blocking connectivitycheck.gstatic.com rather than redirecting it. Add it to your passthrough list but ensure the gateway intercepts and redirects the HTTP traffic. Question: Can I use HTTPS for my entire portal, including the initial redirect? Answer: No. The initial interception must be HTTP. You can redirect from HTTP to HTTPS for the login page itself, but the first redirect from the probe URL must be plaintext HTTP. Otherwise Apple CNA won't trigger, and users will see certificate warnings. --- SUMMARY AND NEXT STEPS — approximately 1 minute To wrap up: Apple CNA, Android Connectivity Check, and Microsoft NCSI are three distinct mechanisms with different probe URLs, different expected responses, and different failure modes. Apple expects HTTP 200 with a specific body. Android expects HTTP 204. Windows runs a dual HTTP and DNS probe and is vulnerable to post-auth looping if your gateway is slow to propagate authorisation. Your walled garden must cover all three probe sets. Your initial redirect must be HTTP. And you should test with all three OS families before any deployment goes live. If you want to go deeper on the RFC 8910 Captive Portal API — the future of this space — or on how Purple WiFi automates walled garden management across multi-vendor infrastructure, head to purple.ai. The Guest WiFi and WiFi Analytics documentation covers the full technical architecture. Thanks for listening. We'll be back with another technical briefing shortly.

header_image.png

Riepilogo Esecutivo

Il rilevamento del Captive Portal è una componente critica ma spesso fraintesa del networking aziendale. Quando un dispositivo si connette a una rete WiFi pubblica, il sistema operativo esegue una serie di sondaggi in background per determinare se l'accesso a Internet è disponibile o se un Captive Portal sta intercettando il traffico. Apple, Android e Windows utilizzano ciascuno meccanismi distinti, con URL di sondaggio, risposte attese e modalità di errore differenti.

Per i responsabili IT e gli architetti di rete che implementano soluzioni Guest WiFi in ambienti Hospitality , Retail o del settore pubblico, una configurazione errata di questi meccanismi di rilevamento comporta un significativo sovraccarico di supporto. Gli ospiti potrebbero visualizzare avvisi di certificato, non riuscire a vedere la splash page o sperimentare cicli di accesso infiniti. Questa guida di riferimento fornisce l'architettura tecnica definitiva di Apple CNA, Android Connectivity Check e Microsoft NCSI, fornendovi le conoscenze pratiche necessarie per costruire walled garden robusti e neutrali rispetto al fornitore e garantire un'esperienza di connessione senza interruzioni.

Approfondimento Tecnico

Apple Captive Network Assistant (CNA)

Quando un dispositivo Apple (iOS o macOS) si connette a una rete, invia immediatamente una richiesta HTTP GET al suo URL di sondaggio primario: http://captive.apple.com/hotspot-detect.html. Il dispositivo si aspetta una risposta HTTP 200 OK con un corpo HTML specifico contenente la parola "Success" [1].

Se la risposta corrisponde a questa aspettativa, il sistema operativo presume un accesso completo a Internet. Se la risposta è diversa, come un reindirizzamento HTTP 302 o un timeout, il sistema operativo attiva il Captive Network Assistant (CNA). Il CNA apre WebSheet, un mini-browser in sandbox con funzionalità limitate (nessuna estensione Safari, nessun salvataggio password) [2].

Vincolo critico: Il sondaggio iniziale è HTTP. Se il vostro gateway intercetta il sondaggio e reindirizza a un URL HTTPS, il CNA fallirà in modo controllato, spesso risultando in un avviso di certificato o una schermata vuota. Il reindirizzamento iniziale deve rimanere sulla porta HTTP 80. Inoltre, se consentite inavvertitamente captive.apple.com attraverso il vostro walled garden, il dispositivo raggiungerà il vero server Apple, riceverà la risposta "Success" e bypasserà completamente il vostro portal.

Android Connectivity Check

Android opera su un principio diverso. Il suo sondaggio primario mira a http://connectivitycheck.gstatic.com/generate_204 (con fallback a clients2.google.com e connectivitycheck.android.com). Invece di aspettarsi una risposta HTTP 200 con contenuto specifico, Android si aspetta una risposta HTTP 204 No Content [3].

Se Android riceve un HTTP 204, presume la connettività a Internet. Se riceve un reindirizzamento o una risposta HTTP 200, contrassegna la rete come captive e visualizza una notifica "Accedi alla rete WiFi". Toccando questa notifica si apre il browser Chrome completo, consentendo un'esperienza portal più ricca rispetto al CNA in sandbox di Apple.

Vincolo critico: Se il vostro walled garden blocca connectivitycheck.gstatic.com interamente invece di intercettarlo e reindirizzarlo, Android visualizzerà un avviso "Connesso, nessun internet" e non chiederà all'utente di accedere.

Microsoft Network Connectivity Status Indicator (NCSI)

Windows impiega un meccanismo a doppio sondaggio tramite il servizio Network Connectivity Status Indicator (NCSI). Al momento della connessione, Windows esegue una richiesta HTTP GET a http://www.msftconnecttest.com/connecttest.txt (aspettandosi una risposta 200 con il testo "Microsoft Connect Test") e una risoluzione DNS per dns.msftncsi.com [4].

Se il sondaggio HTTP viene intercettato, Windows rileva il portal e apre il browser predefinito (Edge). Tuttavia, Windows è soggetto a un problema di loop post-autenticazione. Dopo che l'utente si autentica, Windows riesegue i sondaggi NCSI. Se il gateway non ha ancora propagato l'autorizzazione dell'indirizzo MAC, il sondaggio viene intercettato di nuovo e Windows riapre il portal, costringendo l'utente a un ciclo di accesso.

os_detection_comparison.png

Guida all'Implementazione

Per garantire un rilevamento affidabile del Captive Portal su tutti i dispositivi, è necessario configurare la zona di pre-autenticazione (walled garden) per gestire i requisiti specifici di ogni sistema operativo.

walled_garden_architecture.png

Walled Garden Configuration

Il vostro walled garden deve includere i seguenti host. Fondamentale, dovete intercettare e reindirizzare il traffico HTTP verso questi host, piuttosto che semplicemente consentire loro di passare a Internet.

  • Apple: captive.apple.com, www.apple.com, www.appleiphonecell.com, www.itools.info
  • Android: connectivitycheck.gstatic.com, clients2.google.com, connectivitycheck.android.com
  • Windows: www.msftconnecttest.com, dns.msftncsi.com, www.msftncsi.com (for legacy clients)

Fasi di Implementazione

  1. Configurare la Risoluzione DNS: Assicurarsi che le richieste DNS per gli URL di sondaggio si risolvano correttamente all'interno della zona di pre-autenticazione.
  2. Intercettare i Sondaggi HTTP: Configurare il gateway per intercettare le richieste HTTP GET agli URL di sondaggio e restituire un reindirizzamento HTTP 302 alla splash page del vostro portal.
  3. Mantenere HTTP per il Reindirizzamento Iniziale: Il reindirizzamento iniziale deve essere servito tramite HTTP (porta 80). È possibile reindirizzare l'utente a una pagina di login HTTPS successivamente, ma il primo hop deve essere HTTP in chiaro per soddisfare Apple CNA.
  4. Propagare Rapidamente l'Autorizzazione: Assicurarsi che il gateway aggiorni immediatamente le sue regole firewall dopo un'autenticazione riuscita per consentire il passaggio dei sondaggi NCSI, prevenendo i loop di Windows.

Migliori Pratiche

  • Adottare RFC 8910 (Captive Portal API): I sistemi operativi moderni (iOS 16+, Android 11+) supportano l'opzione DHCP 114, che fornisce un segnale positivo della presenza di un Captive Portal tramite un URL API designato [5]. Ciò elimina la dipendenza dall'intercettazione delle sonde ed è l'approccio raccomandato a prova di futuro.
  • Test su tutte le piattaforme: Non dare mai per scontato che un portale funzioni basandosi esclusivamente su test con un iPhone. Richiedi una matrice di test che includa dispositivi iOS, Android stock e Windows 10/11.
  • Sfrutta le piattaforme automatizzate: La gestione manuale degli URL delle sonde in evoluzione è soggetta a errori. Piattaforme come Purple aggiornano automaticamente le definizioni dei walled garden man mano che Apple, Google e Microsoft modificano la loro infrastruttura, garantendo una raccolta dati WiFi Analytics coerente.

Risoluzione dei problemi e mitigazione dei rischi

Sintomo Causa principale Risoluzione
Apple CNA non si apre; l'utente visualizza un avviso SSL. Il gateway intercetta la sonda e reindirizza direttamente a HTTPS. Assicurarsi che l'intercettazione iniziale e il reindirizzamento utilizzino la porta HTTP 80.
Il dispositivo Apple si connette senza mostrare il portale. captive.apple.com è consentito attraverso il walled garden verso internet. Rimuovere captive.apple.com dalla lista bianca; assicurarsi che sia intercettato.
Android mostra "Connesso, nessuna internet". connectivitycheck.gstatic.com è bloccato dal firewall. Consentire l'URL della sonda nel walled garden, ma intercettarlo e reindirizzarlo.
Windows chiede all'utente di accedere più volte (loop). Il gateway è lento nell'applicare le regole MAC post-autenticazione; NCSI è ancora intercettato. Ottimizzare la propagazione delle regole del gateway; assicurarsi che msftconnecttest.com passi post-autenticazione.

ROI e impatto sul business

Un'architettura robusta di rilevamento del Captive Portal ha un impatto diretto sui profitti. In un hotel di 500 camere o in un grande ambiente di vendita al dettaglio, i fallimenti del Captive Portal generano un volume sproporzionato di ticket di supporto IT. Eliminando questi punti di attrito, le strutture riducono i costi di supporto, migliorano i punteggi di soddisfazione degli ospiti e aumentano il tasso di acquisizione dei dati di prima parte.

Quando gli utenti si connettono senza problemi, interagiscono con le tue splash page, consentendoti di fornire marketing mirato, integrare programmi fedeltà e generare entrate misurabili, come dettagliato nella nostra guida a Indoor Positioning System: UWB, BLE, & WiFi Guide . Per le strutture che operano a livello internazionale, un portale affidabile garantisce una raccolta dati di conformità coerente, supportando i framework discussi nella Brazil LGPD and Guest WiFi: A Compliance Guide .


Riferimenti

[1] Apple Support, "Utilizzare le reti Wi-Fi captive su iPhone o iPad," 2024. [2] SecureW2, "Cos'è Apple Captive Network Assistant?," 2023. [3] Android Developers, "Supporto API Captive Portal," Android 11 Features, 2020. [4] Microsoft Learn, "Rilevamento del Captive Portal ed esperienza utente in Windows," Windows Hardware Developer, 2025. [5] IETF, "RFC 8910: Identificazione del Captive Portal in DHCP e Router Advertisements," 2020.

Termini chiave e definizioni

Captive Network Assistant (CNA)

Apple's built-in mechanism for detecting captive portals and displaying them in a sandboxed mini-browser (WebSheet) rather than the full Safari browser.

IT teams must ensure their splash pages are responsive and do not rely on advanced browser features, as the CNA environment is highly constrained.

Network Connectivity Status Indicator (NCSI)

The Windows service responsible for determining internet connectivity by probing specific Microsoft domains via HTTP and DNS.

Understanding NCSI is critical for preventing the common 'Windows looping' issue where users are repeatedly prompted to sign in.

Walled Garden

A restricted network environment that allows unauthenticated users access to a specific list of approved hostnames or IP addresses.

Properly configuring the walled garden is the foundation of captive portal deployment, ensuring OS probes are handled correctly.

HTTP 204 No Content

An HTTP status code indicating the server successfully processed the request but is not returning any content.

This is the specific response Android devices expect from `connectivitycheck.gstatic.com` to confirm full internet access.

RFC 8910 (Captive Portal API)

An IETF standard that uses DHCP option 114 to explicitly notify a device of a captive portal's presence and provide the portal URL.

This modern standard replaces unreliable probe interception and is supported by newer versions of iOS and Android.

WebSheet

The sandboxed, limited-functionality mini-browser used by Apple's CNA to render captive portal splash pages.

Portal designers must test their pages in WebSheet, as it lacks features like password saving and full cookie support found in standard browsers.

MAC Authorisation

The process by which a gateway grants network access to a specific device based on its Media Access Control address after successful portal authentication.

Delays in applying MAC authorisation cause post-authentication probes (like Windows NCSI) to fail, leading to poor user experiences.

Probe Interception

The technique of capturing an operating system's background connectivity check and forcibly redirecting it to a captive portal login page.

This is the legacy, yet most common, method for triggering captive portals, requiring precise HTTP 302 redirects.

Casi di studio

A 300-room hotel reports that guests using iPhones are connecting to the guest WiFi but are not being prompted with the captive portal splash page. Android and Windows users are unaffected.

  1. Review the walled garden (pre-authentication) allowlist on the gateway.
  2. Identify that captive.apple.com has been added as a permitted passthrough host.
  3. Remove captive.apple.com from the passthrough list.
  4. Configure the gateway to intercept HTTP requests to captive.apple.com and redirect them (via HTTP 302) to the portal URL.
Note di implementazione: This is a classic misconfiguration. By allowing `captive.apple.com` to reach the internet, the Apple device receives the expected 'Success' response and assumes no portal is present. Removing it forces the interception required to trigger the CNA.

A conference centre's IT team receives complaints that Windows 11 users are authenticating successfully but are immediately prompted to sign in again, creating an endless loop.

  1. Verify that the captive portal gateway is successfully authorising the client's MAC address post-authentication.
  2. Inspect the post-authentication firewall rules to ensure traffic to www.msftconnecttest.com and dns.msftncsi.com is permitted.
  3. Adjust the gateway configuration to ensure MAC authorisation is applied instantaneously, preventing subsequent NCSI probes from being intercepted.
Note di implementazione: Windows NCSI re-evaluates connectivity after authentication. If the gateway lags in updating its rules, the NCSI probe is intercepted again, causing Windows to assume the portal is still active. Rapid rule propagation is essential.

Analisi degli scenari

Q1. You are deploying a captive portal for a large retail chain. The security team insists that all network traffic, including the initial portal redirect, must be encrypted using HTTPS. What is the technical implication of this policy?

💡 Suggerimento:Consider how Apple's Captive Network Assistant (CNA) handles initial probe requests.

Mostra l'approccio consigliato

Enforcing HTTPS for the initial redirect will break Apple CNA detection. The CNA probe is an HTTP GET request. If the gateway intercepts this and redirects to an HTTPS URL, the CNA will not follow the redirect gracefully, resulting in a certificate error or a failure to open the portal. The initial interception must use HTTP port 80; the user can subsequently be redirected to an HTTPS page for authentication.

Q2. A stadium network engineer reports that Android devices are showing a 'Connected, no internet' warning without prompting the user to sign in. How should the walled garden be adjusted?

💡 Suggerimento:Think about the difference between blocking a probe and intercepting it.

Mostra l'approccio consigliato

The engineer needs to ensure that connectivitycheck.gstatic.com is allowed to resolve via DNS within the walled garden, but the HTTP traffic must be intercepted and redirected. Currently, the firewall is likely dropping the traffic entirely, causing Android to assume the internet is down rather than detecting a captive portal.

Q3. A venue wishes to implement RFC 8910 (Captive Portal API) to improve the user experience. What infrastructure changes are required to support this?

💡 Suggerimento:RFC 8910 relies on a positive signal during the IP assignment phase.

Mostra l'approccio consigliato

The venue must update its DHCP server or access points to advertise DHCP option 114. This option must provide the URL of the Captive Portal API endpoint. When compatible devices (iOS 16+, Android 11+) receive this option during the DHCP handshake, they will immediately fetch the API and prompt the user, bypassing the need for HTTP probe interception.

Apple CNA, Android Connectivity Check, Microsoft NCSI: Come funziona realmente il rilevamento del Captive Portal | Technical Guides | Purple