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

Message
Author
User avatar
m_pav
Developer
Posts: 1877
Joined: Sun Aug 06, 2006 3:02 pm

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

#11 Post 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.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

Nue_fell0
Posts: 8
Joined: Sat Nov 11, 2023 10:21 pm

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

#12 Post 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

User avatar
CharlesV
Administrator
Posts: 8009
Joined: Sun Jul 07, 2019 5:11 pm

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

#13 Post 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?
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

Nue_fell0
Posts: 8
Joined: Sat Nov 11, 2023 10:21 pm

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

#14 Post 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.

User avatar
CharlesV
Administrator
Posts: 8009
Joined: Sun Jul 07, 2019 5:11 pm

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

#15 Post by CharlesV »

:cool2:
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
bassplayer69
Posts: 69
Joined: Wed Dec 25, 2019 5:37 pm

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

#16 Post 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.
"The world is full of kings and queens, who blind your eyes and steal your dreams. It's Heaven and Hell." - Ronnie James Dio
Linux Registered User #450992 (defunct)

User avatar
seaken64
Posts: 819
Joined: Wed Jan 02, 2019 1:43 pm

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

#17 Post 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
MX21-64 XFCE & W11 on Lenovo 330S LT. MX21-KDE & MX21-XFCE on Live USB.
MX18-64 & W7, Fedora on HP Core2 DT
MX21-32 XFCE w/ MX-Fluxbox on P4HT DT w/ antiX21, SUSE Tumbleweed, Q4OS, WXP
antiX21 on Compaq PIII 1 Ghz DT, w/ Debian, MX18FB, W2K

User avatar
m_pav
Developer
Posts: 1877
Joined: Sun Aug 06, 2006 3:02 pm

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

#18 Post 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.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

Charlie Brown

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

#19 Post 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 ...

User avatar
DukeComposed
Posts: 1506
Joined: Thu Mar 16, 2023 1:57 pm

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

#20 Post 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.

Post Reply

Return to “Software / Configuration”