Getting the login screen on hotel WiFi using Linux
Problem
I can see that I am connected to the hotel WiFi on my laptop, but the login screen does not come up on my browser. So I cannot access the Internet.
My laptop is connected to a private IP address on the hotel network, but I cannot access the login page on a browser to get access to the world wide web
I run Debian 10, using the i3 tiling manager. I use wicd as my network manager and Firefox as the browser.
My mobile phone automagically connects to the hotel WiFi and brings up the login screen. So I know that the WiFi is working and allows access to the Internet.
How do I get the WiFi login screen on my laptop?
Solution - short answers
use http://neverssl.com/
I had a comment a while back that suggested a shorter solution than I found. I have yet to test out the idea though. The contributer suggests entering an http (not an https site) into your browser: http://neverssl.com/
Check that you have 8.8.8.8 in /etc/resolv.conf so that the address for neverssl.com can be found.
Using iproute
Type:
ip route
Example output:
default via 192.168.96.1 dev wlp3s0 192.168.96.0/20 dev wlp3s0 proto kernel scope link src 192.168.108.193
Look at the first line ‘default via 192.168.96.1’. Put the value 192.168.96.1, or whatever you have for that value in the first line, into your browser address bar. This should take you to the login screen.
Using /etc/resolv.conf
Look in the file /etc/resolv.conf after connecting to the WiFi and type the private IP address in this file into your browser.
To see the contents of this file, type:
more /etc/resolv.conf
Here’s the output I got. Yours will probably have a different content:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.96.1 nameserver 8.8.8.8 nameserver 8.8.4.4
When I put the private IP value (192.168.96.1 in this example) into Firefox, the login screen appeared.
Victory looks like this - the hotel login page
That’s all folks!
Hopefully, one of these methods works for you. I put an expanded explanation and the background story below. I like background stories. Makes me feel like I’m not the only one who has trouble figuring things out.
I recommend using a VPN when accessing the world wide web. This adds a layer of security when using public networks.
Background
Our internet connection use a domain name system(DNS) server to find out where to go to get the contents for the web addresses we ask it to access. The file /etc/resolv.conf contains the IP addresses of the DNS servers in use by the current connection. This file is automatically created when you set up a new connection.
Looking at the contents of /etc/resolv.conf after I connected with the hotel WiFi, I recognise the IP addresses 8.8.8.8 and 8.8.4.4 as Google DNS addresses. This makes sense. Google will have a database of what website is where if anybody does.
The IP addresses 192.168.0.0 to 192.168.255.255 are reserved for private network addresses.
The IP address of 192.168.96.1 in the file /etc/resolv.conf is one of the addresses reserved for private networks. So this looks to be the local access point. This makes sense. The IP address for the login page is a private address on the hotel network, not accessible on the world wide web where anybody could have a go at logging in to the hotel WiFi.
Putting this IP value (192.168.96.1) into Firefox has us directed to the local login page.
I finally got to grips with this during the Covid 19 pandemic. I spent some time quarantining in a hotel in Rio de Janeiro before joining a survey ship to work offshore Brazil and had trouble getting on the hotel wi-fi.
It works, then doesn’t the next time you use it
Try clearing the browser cache.
Disable any VPN you are using while connecting, then re-enable the VPN.
I hope this post is of use to others. I welcome any comments and corrections.
Comments
A kind comment received on 21st Sept 2024:
“Thanks been 2 hrs and even called the front desk and no help two seconds of reading and bam. I have never struggled so much with this simple task but thanks a mill from Phoenix, Arizona!!”