72

As a long time user of Ubuntu (10y+) I have noticed the relationship between Ubuntu and public Wifi hotspots (without wifi security) that require login through a web page have not always been easy...

At times, I was able to be automatically redirected to a web page for logging in, but I have been experiencing the same problem for a while: after connecting to the open wifi network, the browser does not redirect to the login page! I have just updated to 16.04 and I was disappointed to see it did not fix the problem.

I tried deleting the connection from Network Manager but this doesn't change anything. The behaviour is the same with any browser (Chromium, Firefox, Opera, etc). I have dual-boot on this machine and no problem connecting to those network in Windows...I don't really know what else to try...

Is anyone else experiencing this issue? Any help to troubleshoot (or solve) the problem is highly appreciated. Please let me know if you need command outputs for diagnostics.

Update: Today, I did manage to connect to one of these wifi networks, but received a warning first :

enter image description here

However, I tried to connect to a Starbucks network afterwards and still have the same problem. Thaller below pointed to a possible problem in the NetworkManager.conf file: could anyone maybe post a normal file so I can see what's wrong with mine?

R Pennese
  • 1,265

13 Answers13

56

Here is what I have found works for forcing the captive portal (i.e., login page for WIFI connections on public hotspots):

  1. Make the connection to the WIFI.

  2. Open a terminal and type route -n. You should receive a display such as:

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    
    default         10.1.0.1        0.0.0.0         UG    600    0        0 wlo1    
    10.1.0.0        *               255.255.248.0   U     600    0        0 wlo1    
    link-local      *               255.255.0.0     U     1000   0        0 wlo1```
    

  3. Type the default Gateway (i.e., 10.1.0.1) into your browser's address bar, you will receive the WIFI login page.

Filbuntu
  • 13,891
scarrick
  • 569
20

Enter http://nmcheck.gnome.org in your browser. (I added the "hotspot login" of Ubuntu 18 to my favorites and it showed that address, every time I clicked on it.) It worked for me.

Kyrill
  • 329
12

I have the same problem and I am going to add the following to my /etc/NetworkManager/NetworkManager.conf file:

[connectivity]
uri=http://nmcheck.gnome.org/check_network_status.txt

(source)

David Foerster
  • 36,890
  • 56
  • 97
  • 151
Kharm1
  • 131
11

For me,

sudo dpkg-reconfigure resolvconf

completely solved the problem. I hope it will help you.

Byte Commander
  • 110,243
4

Guruprasad L's blog post's answer for me.

  1. Create file /etc/NetworkManager/conf.d/20-connectivity-debian.conf (you'll need root or sudo).
  2. Add the following lines as recommended by Guruprasad:

    [connectivity]
    uri=http://network-test.debian.org/nm
    response=NetworkManager is online
    interval=300
    
  3. Restart the network manager with service network-manager restart (will need sudo or root again).

jtpereyda
  • 2,115
  • 3
  • 20
  • 21
3

NetworkManager is a bit involved in this. When you configure connectivity-checking (see man NetworkManager.conf), then it will try periodically to download a website to see whether it has internet access. This is also used to detect a captive portal. Based on this, NetworkManager has a Connectivity state, which might be one of Local, Portal, Full.

Appart from that, NetworkManager does nothing. When using gnome3, gnome-shell looks at that connectivity state and might open a portal-login page, that is a browser with some website. Maybe there are other components that perform a similar task like NetworManager's connectivity check or gnome-shell's portal-login.

In the end, you can also do without these two. When you are behind a captive portal you can open a browse to a HTTP site (not HTTPS), the portal will redirect you to a login page.

Maybe you are not redirected because you are trying to open a HTTPS site. The portal usually blocks that entirely, because attempting to redirect it would anyway result in a certificate warning.

thaller
  • 981
2

Running route -n should have a first entry that looks something like:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.31.0.1      0.0.0.0         UG    20600  0        0 wlan0

If you can ping the gateway (e.g. ping 172.31.0.1) and if you know the URL for the captive portal (from connecting on your phone or another computer), you should be able to link these two to get to a login screen. Edit your hosts file sudo vi /etc/hosts and add an entry like:

172.31.0.1 gialto.wifi/hotspot/novotelmedellinguest

(Replace gialto.wifi/hotspot/novotelmedellinguest with the full address of the wifi login)

Then uncheck "enable networking" in the wifi settings in the upper right of your desktop and recheck it. Finally enter the full address in your browser (make sure to start with http:// if your browser is attempting to do a search instead of a lookup).

1

I had the same problem. The login page of the networks just never showed up and the login screen window was broken. The cause was a dangling wireguard connection. After disabling that connection, all was fine.

Michael
  • 131
1

This problem can also be caused by a VPN. I'm using NordVPN on my Android phone and Ubuntu laptop. On Android the WiFi login page appears with the VPN enabled, but on Ubuntu I have to disable the VPN to get the WiFi login page to appear.

ntc2
  • 700
0

This will likely be of no help to anyone, but I got xfinitywifi working on my Windows partition, then fiddled around with the MAC address until it suddenly started working. I can't replicate it currently.

qwr
  • 2,969
0

I was getting a domain name resolution error when my browser tried to open the login page. If you have another internet source available, like a phone, you can look up the ip address using a service like https://www.nslookup.io/

I then replaced the domain name in my web browser url with the ip address and everything worked.

0

This solution worked for me on an Ubuntu computer with a camera and required a phone (Android) that had been connected and logged into the Wi-Fi network.

On the Ubuntu computer establish a Bluetooth network connection to the phone —i.e., tether it. Install the wifi-qr package on the Ubuntu computer. Untether it. On the phone, bring the QR code to share the network password up on the screen. On the computer, in a terminal, run wifi-qr s and scan the QR code using the computer's camera. Repeat if necessary.

jdthood
  • 12,625
0

For future answers searchers, I had the exact same problem suddenly in Chromium for Ubuntu 16.04, but trying to navigate to a site in Firefox showed me the login page for the network.

Aruku
  • 11