Networking/Captive Portal Debugging
What's a captive portal?
A captive portal is the login or terms-and-conditions page that appears when you connect to many public Wi-Fi networks. Before you're allowed onto the Internet, you may need to sign in, enter some information, pay, or simply click a button to accept the network's terms.
Firefox Desktop has a captive portal detection service that periodically makes a request to a known endpoint. The response tells Firefox whether it has normal Internet access or whether the network is intercepting requests and requires you to interact with a captive portal.
We're particularly interested in cases where this detection doesn't work as expected.
What can go wrong?
We've generally seen problems fall into two categories:
- Firefox is treated differently. The hostname Firefox uses for captive portal detection may be handled differently from the hostnames used by other browsers or operating systems. This can mean that Firefox doesn't show the captive portal notification when it should, or that the notification never goes away after you've logged in.
- The captive portal itself is broken. The network may continue redirecting our connectivity check even after you've logged in or accepted the terms. In some cases, the login page itself may fail to load correctly.
If you encounter either of these — or anything else that looks like broken captive portal behavior — we'd love to get some information about it.
Filing a bug
Please file a new bug blocking bug 2036862 (captive-portal-service). You can use this link, which will set that up automatically:
Please include as much of the following as you can:
- Location: Airport, airline/flight, train, hotel, etc. Please be reasonably specific.
- Captive portal provider: If you can identify the provider, include it. Otherwise, the URL/hostname of the page you're redirected to is useful.
- What went wrong: For example, Firefox didn't detect the portal, the captive portal notification remained after logging in, or the login page didn't work.
- Other browsers: Did the captive portal work correctly in Chrome, Safari, Edge, etc.?
- curl output: Before logging in or accepting the terms, run:
curl -v http://firefox-portal-detection.com/generate_204
If possible, run the same command again after successfully getting online and include both outputs.
Please try to capture the first result before opening another browser or interacting with the operating system's captive portal window, since doing so may authenticate the device and change the captive portal's behavior.
- Firefox logs: If possible, capture a networking log while reproducing the problem:
- Open
about:loggingin Firefox. - Select the Networking logging preset.
- Click Start Logging.
- Reproduce the captive portal problem (including logging in or accepting the terms, if possible).
- Return to
about:loggingand click Stop Logging. - Attach the resulting log to the Bugzilla bug.
- Open
You may not be able to upload the log while the captive portal is preventing Internet access. That's fine — save it locally and attach it once you're back online.
How to change your mac address
If you used another browser to log in or accept the captive portal's terms before collecting anything, you haven't necessarily missed your chance.
Captive portals commonly identify devices by their MAC address. Changing your MAC address can therefore make the network treat your computer as a new device and present the captive portal again.
The easiest way to do this depends on your operating system. (Note: the following instructions were not properly verified and may not work).
macOS
Recent versions of macOS support private Wi-Fi addresses:
- Open System Settings → Wi-Fi.
- Click Details… next to the network.
- Change the Private Wi-Fi address setting. Toggling it off/on or changing its mode can cause macOS to use a different MAC address.
- Disconnect and reconnect to the Wi-Fi network.
Windows
Windows can use randomized hardware addresses for Wi-Fi:
- Open Settings → Network & internet → Wi-Fi.
- Open the properties/settings for the Wi-Fi network.
- Find Random hardware addresses and change its setting.
- Disconnect and reconnect to the network.
The exact location of this option varies slightly between Windows versions and Wi-Fi drivers. Some adapters don't support it.
Linux
If you're using NetworkManager, you can ask it to use a random MAC address for the connection.
First find the connection name:
nmcli connection show
Then set a random MAC address:
nmcli connection modify "<connection name>" 802-11-wireless.cloned-mac-address random
Disconnect and reconnect:
nmcli connection down "<connection name>" nmcli connection up "<connection name>"
To restore the default behavior afterwards:
nmcli connection modify "<connection name>" 802-11-wireless.cloned-mac-address preserve
Please only do this if you're comfortable changing your network settings. Collecting partial information without reproducing the problem is still useful.