Unable to connect through a captive portal

I am trying to use a public WiFi network that uses a captive portal. When I start the computer and connect to the WiFi network, I see a message asking me to log in. When I click on it, Chrome (which is my default browser) is launched and goes to networkcheck.kde.org at which point it just stops. I get the following message:

This site can't be reached
networkcheck.kde.org unexpectedly closed the connection

When I try going to detectportal.firefox.com/canonical.html instead, I see that I get redirected to a captive portal url but end up with the same error message but with a different url instead of networkcheck.kde.org.

I know that the captive portal is working fine because my phone (iOS) and windows laptops connect without any issues. How do I troubleshoot this?

I don’t quite understand what was wrong to begin with but running the following did the trick [source]:

xdg-open http://$(ip --oneline route get 8.8.8.8 | awk '{print $3}')

This command essentially looks up your routers ip adress and runs xdg-open with that ip.
Example: xdg-open http://192.168.1.1

This command essentially looks up your routers ip adress and runs xdg-open with that ip.

Yup, I figured as much.

But the question remains… why did I have to do that? Why did networkcheck.kde.org (or detectportal.firefox.com or even Apple’s captive portal detecting URL that I used) not able to figure that out on their own? Where is the system failing and how can I figure that out? Right now, it’s just a complaint that the feature is not working as advertised. If I could be a bit more constructive and provide details about where things are failing (they might very well be something on my end) there may be a path forward to a resolution.

1 Like

Good questions.

Is the router also your nameserver (DNS server?)

In the thread you posted your solution from it mentiones and links to information about systemd-resolve and dnsmasq.

Maybe there is something here that is creating problems for you.
Could be a networkmanager thing.

I am not sure how to check that. This is not my router. It is at the place I work and I have no control over most of the stuff.

I tried almost everything in that thread. Really, the only thing that worked for me in the end was what I have posted. Admittedly, I (still) do not know entirely what I was doing other than just trying things out.

Not so sure it has to do with dns any more after reading a little.
But you can find what dns is configured with:
cat /etc/resolv.conf

I have ideas, but since you are on Neon, I think it is better someone on that distro would advice.

Everything I find on the internet seems to one way or another point back to the arch wiki, so you could try creating the script from there and test.

https://wiki.archlinux.org/title/NetworkManager#Captive_portals

This is what I have in my /etc/resolv.conf:

nameserver 127.0.0.53
options edns0 trust-ad
search .

I am currently not connected to my work WiFi, in case that matters. I can check the contents of this file again when I am at work to see if something has changed.

Getting the same issue with KDE Plasma on Arch Linux running NetworkManager, systemd-resolv and iwd backend for wifi. When I click on “log In” button on the Network applet , it opens networkcheck.kde.org but its fails to open the captive portal with the following error:


But http://nmcheck.gnome.org/check_network_status.txt and other URLs work fine. I tried changing config files in /etc/NetworkManager/conf.d/, /etc/NetworkManager/conf.d. But still it opens networkcheck.kde.org and fails.
I even tried making changes /usr/share/plasma/plasmoids/org.kde.plasma.networkmanagement/contents/ui/main.qml but still clicking the button opens networkcheck.kde.org.

Yup, networkcheck.kde.org has been nothing but a pain for me. I don’t think it really ever worked for me. I use detectportal.firefox.com/canonical.html instead.

One observation – when I go to networkcheck.kde.org from a Chrome Incognito window, it works as expected.

@Lavish – can you please give it a try too see if that helps in your case as well?

How do I change the captive portal check in KDE? The default is hit and miss for me. As mentioned above, my router address always works. Obviously, that is going to be blocked when I’m not home and need to log in to public wifi but it’s pretty reliable for pulling up the login page.