What Is a Captive Portal? End-to-End Network to RADIUS Flow

· Guest WiFi and Captive Portal

What Is a Captive Portal and What Problem Does It Solve?

A captive portal is a network access control mechanism that intercepts a newly connected guest device before granting unrestricted internet connectivity, guiding the user through authentication, policy acceptance, or onboarding steps. Even though the client device has joined the wireless SSID at the link layer, the router keeps it inside a restricted pre-authentication state until portal requirements are completed.

Beyond controlling internet access, a captive portal establishes a reliable link between each physical device, its assigned local IP address, session duration, bandwidth limits, and technical access logs. To understand how these components fit into the broader platform, review the Hotspotly architecture overview.

Steps 1 and 2: SSID Association, DHCP Lease, and OS CNA Detection

When a visitor selects the guest WiFi SSID on a smartphone or laptop, the captive portal workflow starts at the network layer before any user opens a browser tab. First, the device sends a DHCP Discover broadcast and receives a local IP address, subnet mask, default gateway, and DNS server from the DHCP pool attached to the router’s guest interface. On MikroTik routers provisioned by Hotspotly, that DHCP server runs with use-radius=accounting enabled so IP-to-MAC lease bindings are accurately tracked.

Immediately after obtaining an IP address, the device’s operating system invokes its Captive Network Assistant (CNA). Operating systems such as iOS, macOS, Android, and Windows automatically issue lightweight cleartext HTTP connectivity probes to known test endpoints. Because modern TLS checks reject silent man-in-the-middle interception of HTTPS traffic prior to login, captive portal detection intentionally relies on HTTP probes.

The MikroTik /ip hotspot server intercepts cleartext HTTP requests originating from clients without an active session and serves a redirect via its local login.html template. Because the OS receives a redirect instead of the expected probe response, it detects the captive environment and opens the system sign-in sheet automatically. If a specific device suppresses the automatic sheet, opening any http:// URL in a web browser triggers the exact same redirection path.

From login.html to the Isolated Portal Domain and Walled Garden Pre-Allow List

During Hotspotly router provisioning, minimal portal redirect files are fetched into hotspotly/<hotspot-id>/ on the MikroTik router. When triggered, login.html forwards the guest browser to the isolated cloud portal domain, carrying essential session context such as the client IP, MAC address, router login endpoint (link-login-only), and CHAP challenge tokens (chap-id and chap-challenge).

Because the guest is not authenticated yet, the router’s firewall blocks general internet traffic and permits reachability exclusively through the walled garden list. Hotspotly automates walled garden management for its own portal and active login methods so administrators do not need to maintain those host rules by hand: it permits the dedicated portal domain plus only the domains needed by login methods that are both enabled and properly configured—such as Google OAuth or Facebook Login endpoints. Server-side verification methods including SMS OTP, vouchers, username/password, PMS room lookup, and click-through need no extra external domains in the walled garden. Full details of what gets written to the router appear in the portal provisioning guide.

Step 3: Processing Authentication Methods and Legal Checkboxes

Once the browser loads the branded interface from the guest portal domain, the guest sees the venue’s customized layout in their detected browser language along with the active legal notice controls. Privacy notice acknowledgment and terms of service acceptance are enforced before connection, while optional marketing consent remains unchecked by default and does not block WiFi access by design.

The guest then completes whichever login method the venue has enabled:

  • SMS OTP: Entering a six-digit one-time passcode delivered to the guest’s mobile number.
  • Voucher code: Submitting a pre-generated access code with defined validity or quota rules.
  • Google or Facebook login: Completing an OAuth sign-in flow against the configured provider app.
  • PMS verification: Matching a hotel guest’s room number and surname against the property management system.
  • Username and password: Signing in with credentials created inside the panel.
  • Click-through: Accepting the venue’s terms in a single step where allowed by policy.

Each method’s prerequisites and configuration behavior are detailed in the login methods overview.

Step 4: HTTP-CHAP Return and RADIUS Access-Request / Access-Accept

After successful verification on the guest portal domain, Hotspotly issues session credentials and redirects the guest browser back to the router’s link-login-only endpoint. During default provisioning, Hotspotly configures the hotspot server profile with login-by=http-chap while disabling cookie, mac, and trial modes so logins pass through portal validation by design. With HTTP-CHAP, the browser combines the router’s chap-id and chap-challenge values to transmit an MD5 challenge response rather than sending plaintext credentials over the wireless segment.

Upon receiving the HTTP-CHAP submission, the MikroTik hotspot server wraps the credentials, client MAC/IP, and device tunnel source address into a RADIUS Access-Request packet and dispatches it across the encrypted WireGuard or L2TP/IPsec VPN tunnel to Hotspotly’s cloud RADIUS server using the router’s unique per-device RADIUS secret.

The cloud RADIUS server validates the device origin, credentials, active subscription state, and configured speed or time limits. When everything checks out, it responds with a RADIUS Access-Accept packet containing any applicable session timeout or rate-limit attributes. MikroTik immediately registers the guest in /ip hotspot active, lifts the pre-login firewall block for that IP and MAC pair, and redirects the guest to the configured post-login landing page.

Step 5: Five-Minute Accounting Updates and CoA / Disconnect (UDP 3799)

Session Accounting via 5-Minute Interim Updates

RADIUS interaction continues throughout the guest’s session. As soon as access opens, MikroTik sends a RADIUS Accounting-Start packet. Because provisioning configures radius-interim-update=5m on the hotspot profile, the router dispatches periodic interim accounting packets every five minutes carrying elapsed session duration and upload/download byte counters. When the guest logs off or times out, an Accounting-Stop packet closes the session record.

Dynamic CoA / Disconnect (UDP 3799) and API Fallback

When an active session ends before its scheduled timeout, dynamic session control takes over. Hotspotly configures /radius incoming with accept=yes on UDP port 3799, restricted by firewall rules to accept traffic only from the server’s VPN tunnel IP. If an administrator terminates a session, deletes a guest account, revokes a voucher batch, receives a PMS check-out webhook, or suspends an account, Hotspotly sends a RADIUS Disconnect / CoA message through the tunnel to UDP 3799.

The router immediately drops the active session so subsequent traffic redirects back to the portal; if a legacy configuration fails to answer CoA, Hotspotly falls back to removing the /ip hotspot active entry via the tunnel-restricted RouterOS API. Meanwhile, DHCP lease accounting keeps IP-to-MAC mappings synchronized across reconnects. Discover more operational controls on the Hotspotly features page.

All posts