Page 1 of 1

All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Thu Nov 30, 2023 7:59 pm
by Nue_fell0
hello forum, i decided to go 100% all linux and installed MX on my former c:\ erasing windows. Was very happy. everything was great until first time I go to starbucks.

I order coffee and sit down then there is no pop-up for captive portal/wifi access login. I tried to go to chain restaurant close by with wifi and same thing. My cell phone immediately prompts with login page from starbucks router. my previous win11 OS was always able to connect after wifi pop-up agreement. but, quite literally, nothing happens when I open a linux browser. I tried firefox, brave, chromium, libre etc. Made sure vpn disabled. even uninstalled vpn client and restart. Nothing succeed in calling the automatic pop-up like phone & windows. I found some info to ping google from terminal/ensure DNS is set to automatic, use terminal to get access point ip and type into browser, and quite a few other things. But no luck after some hours. For curiosity, I stopped at a small independent cafe with a router like home. the cashier told me the password and instantly i'm online. But any commercial chain like starbucks or hotel. it is a failure. only phone and windows works. Any ideas would be appreciated. I feel foolish not figuring this out. I would bet it is some few lines in terminal I am unaware of.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Thu Nov 30, 2023 8:14 pm
by CharlesV
Welcome in!

Please post your QSI ( MX Menu | Quick System Info | Copy for Forum | paste here )

Usually, I have seen this on my portal installations when caching is getting in the way. Try clearing your browser cache or refreshing the page once connected and see if that helps.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Thu Nov 30, 2023 8:17 pm
by j2mcgreg
In MX 23, the firewall is on by default. Disable it when you want to use a hot spot and see if that makes a difference.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Thu Nov 30, 2023 9:14 pm
by Charlie Brown

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Thu Nov 30, 2023 9:20 pm
by Charlie Brown
Nue_fell0 wrote: Thu Nov 30, 2023 7:59 pm... ensure DNS is set to automatic ...
Also add 1.1.1.1 and/or 8.8.8.8 in IPv4 tab .

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Tue Dec 05, 2023 5:36 am
by Nue_fell0
Hello guys,
for the sake of work I had to reinstall windows shortly after posting here. I fully intend to wipe my hd and install MX again this weekend. I will run through these suggestions & will post how it goes. I aim to make MX the daily driver OS for my laptop as it is now for my desktop!

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 1:15 pm
by Nue_fell0
Well gents, I tried the suggestions and no luck. I'm wouldn't doubt that attempting the steps from the archwiki may not have succeeded because I am not yet that proficient, however I am about to try another experiment. I know this laptop had no issues when it is running win11, so I am now about to try ubuntu just for the hell of it, to see if it "just works" i hate to say. IF it infact it does 'just work' I am wondering if this is something the MX devs/maintainers need to work on. I am sold on Linux i see the light. I am very happy with MX on desktop, but i as soon as i start explaining the trouble to connect to the net at a coffee shop my apple friend rolling his eyes asking why i just dont' get a mac. but that is ok

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 1:29 pm
by rich
You can also try going to a non-ssl site like http://www.neverssl.com to see if that lets your browser redirect to the captive portal log in

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 1:49 pm
by Nue_fell0
rich wrote: Sat Dec 16, 2023 1:29 pm You can also try going to a non-ssl site like http://www.neverssl.com to see if that lets your browser redirect to the captive portal log in
hello Rich, when the issue originally happened I did stumble across that link as a way to 'kickstart' the browser to pull up the starbucks captive portal. it did not work for me that day unfortunately

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 1:52 pm
by CharlesV
On the ubquiti portals that I run, if there is a custom / static DNS ( such as in a VPN or static setup), then the proper DNS ( the portal router) is not checked and then there is no Sign On dialog screen.

This doesnt always happen, but 9 out of 10 times this has been the issue when I am called. (And that is windows, MAC or linux - doesnt matter if the machine is not 100% dhcp dns.)

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 1:59 pm
by m_pav
This may be of assistance, a post I made on Social media

Captive Portal? phooey.
So I had to stay at a holiday camp overnight while my son was in hospital and the camp has free WiFi through a captive portal.
I've seen people ask why MX does not work with captive portals, but never had the issue myself because I always have my hotspot available with data to spare, but where I'm staying for a night, the Cellular service is slloooww, so I thought I'd give the campsites free WiFi a try.

Fired up my MX travelling laptop and sure enough, it would connect but Firefox failed to pull up the simple Captive Portal page to login. No problem, been here before and knowing that most captive portals are not that well configured, I checked that apt could get through, yep, installed Google-Chrome, fired it up and it went through the CP without needing to sign in to it, so here I am sending out this post while bypassing a layer of "security" or authentication. I've only seen this in Linux, never in Windows or Mac, so it only goes to show, most IT people are too blind to realise the real world runs on Linux and they should pay it more attention.

It pauses every minute for a second, so I wonder what the CP hosts logs will look like? Will they call an IT person to investigate, most likely not. It also raises a question about Google Chrome and how it bypasses the captive portal, what it says about Google and how intrusive they can be.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 2:02 pm
by Nue_fell0
CharlesV wrote: Sat Dec 16, 2023 1:52 pm On the ubquiti portals that I run, if there is a custom / static DNS ( such as in a VPN or static setup), then the proper DNS ( the portal router) is not checked and then there is no Sign On dialog screen.

This doesnt always happen, but 9 out of 10 times this has been the issue when I am called. (And that is windows, MAC or linux - doesnt matter if the machine is not 100% dhcp dns.)
Hello CharlesV, yes I did have a vpn initially. I went as far as to uninstall it using --purge option and restart the system to ensure services reset and also disabled the default firewall. I have not other static or custom dns settings or need for them. When exhausting those things to check is when i tried here at the forum finally

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 2:06 pm
by CharlesV
Got it. So.. when connected to this coffee shop, if you do the following:

Code: Select all

ip address 
and also do

Code: Select all

cat /etc/resolv.conf

what are the results?

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 2:34 pm
by Nue_fell0
well i am not at the coffe shop now, but am doing ubuntu install process. however if the captive portal pops up and i am connected just like windows os, then i will get those ip address and resolv.conf results. If ubuntu is seamless and successful at this, i will still reinstall MX. then try again to see the difference in results. I am the kind to try and understand the problem and perhaps help make user experience little easier for others so there is no need to edit configuration files or bash script with nano just for something as routine as open youtube or slashdot at a starbucks for lunch.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sat Dec 16, 2023 2:39 pm
by CharlesV
:cool2:

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Sun Dec 17, 2023 6:43 pm
by bassplayer69
Nue_fell0 wrote: Thu Nov 30, 2023 7:59 pm hello forum, i decided to go 100% all linux and installed MX on my former c:\ erasing windows. Was very happy. everything was great until first time I go to starbucks.

I order coffee and sit down then there is no pop-up for captive portal/wifi access login. I tried to go to chain restaurant close by with wifi and same thing. My cell phone immediately prompts with login page from starbucks router. my previous win11 OS was always able to connect after wifi pop-up agreement. but, quite literally, nothing happens when I open a linux browser. I tried firefox, brave, chromium, libre etc. Made sure vpn disabled. even uninstalled vpn client and restart. Nothing succeed in calling the automatic pop-up like phone & windows. I found some info to ping google from terminal/ensure DNS is set to automatic, use terminal to get access point ip and type into browser, and quite a few other things. But no luck after some hours. For curiosity, I stopped at a small independent cafe with a router like home. the cashier told me the password and instantly i'm online. But any commercial chain like starbucks or hotel. it is a failure. only phone and windows works. Any ideas would be appreciated. I feel foolish not figuring this out. I would bet it is some few lines in terminal I am unaware of.
This happens on windows (windows 10) as well. I was at a hotel on Friday night and captive portal/wifi access login wouldn't kickstart Waterfox (Firefox base). I had to got through the windows reset networking before it finally worked after doing that and rebooting my laptop.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Mon Jan 01, 2024 11:51 pm
by seaken64
I don't really know the answer for your portal problem. I hope you get it sorted out. But my tip is to Dual-boot MX with Windows. That way you can always use Windows in a pinch if Linux is not cooperating for some reason.

I always keep Windows installed on a partition even if I rarely use it. Use Disk Manager to shrink your Windows partition and then create two new partitions for Linux, one for Linux Swap and one for the distro. Then run the Linux installer and select your partitions rather than allowing the installer to use the entire disk drive.

Seaken64

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Tue Jan 02, 2024 12:48 am
by m_pav
Or you could just try to use Google Chrome, like I did in my example earlier in this thread, or a chromium based browser.

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Tue Jan 02, 2024 4:58 am
by Charlie Brown
... And maybe assigning it as the default browser would make it easier to work .
seaken64 wrote: Mon Jan 01, 2024 11:51 pm... Use Disk Manager to shrink your Windows partition ...
Just, at this point, doing that using Windows itself (when booted to Windows) gives the best results, no errors, no complaint from Windows (the "cry baby" ) at first boot ...

Re: All-In on MX Linux, but can not connect from any cafe/hotel wifi

Posted: Tue Jan 02, 2024 3:58 pm
by DukeComposed
Nue_fell0 wrote: Sat Dec 16, 2023 1:15 pm Well gents, I tried the suggestions and no luck. I'm wouldn't doubt that attempting the steps from the archwiki may not have succeeded because I am not yet that proficient, however I am about to try another experiment. I know this laptop had no issues when it is running win11, so I am now about to try ubuntu just for the hell of it, to see if it "just works" i hate to say. IF it infact it does 'just work' I am wondering if this is something the MX devs/maintainers need to work on. I am sold on Linux i see the light. I am very happy with MX on desktop, but i as soon as i start explaining the trouble to connect to the net at a coffee shop my apple friend rolling his eyes asking why i just dont' get a mac. but that is ok
I run a full DNS resolver on my laptop. I do this because as I travel I can't always trust local wifi providers to give me honest answers, which is now known as a captive portal and is pretty common. So my local machine runs a resolver which forwards all its queries to a local DNSCrypt proxy. That way, my DNS lookups go untouched by my ISP or the local coffee shop who's lending me their connection.

As Charlie Brown mentioned, Filippo Valsorda has built a Go wrapper called captive-browser which detects the default name server offered by the wifi access point and then invokes an incognito Chrome session with some proxying to use that name server. He goes into more detail about it in a blog post.

I went through the code and found the command to run on MX Linux to see what the offered name server is:

Code: Select all

nmcli dev show | grep IP4.DNS
If you're unwilling or unable to use Filo's captive-browser approach, this command will give you the DNS server your local coffee shop wants you to use.

From there, you should be able to use that IP address long enough to agree to their terms of service, get blessed to use their wifi connection, and then switch back to whatever DNS settings you actually want or need.

A basic script to do this might look something like this:

Code: Select all

#!/bin/sh
cp -p /etc/resolv.conf /tmp/resolv.conf.backup
echo nameserver ${1} > /tmp/resolv.conf.new
chmod 0644 /tmp/resolv.conf.new
sudo mv /tmp/resolv.conf.new /etc/resolv.conf
Use with caution, this comes with no warranty, I haven't tested this, your actual mileage may vary, caveat emptor, et cetera, et cetera.

I do something similar to this with my setup, wherein I forward my local resolver's queries to the captive portal DNS server long enough to get real Internet access, then point it back to my local DNSCrypt proxy. That's a more complex setup than what you probably need, but the basic idea is the same: use the captive portal's DNS just long enough to make it happy, then go back to using something you trust.