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 :
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?
69 Answers
Here is what I have found works for forcing the captive portal (i.e., login page for WIFI connections on public hotspots):
Make the connection to the WIFI.
Open a terminal and type
route. 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 wlo1Type the default Gateway (i.e.,
10.1.0.1) into your browser's address bar, you will receive the WIFI login page.
I have the same problem and I am going to add the following to my /etc/NetworkManager/NetworkManager.conf file:
[connectivity]
uri=(source)
4For me,
sudo dpkg-reconfigure resolvconfcompletely solved the problem. I hope it will help you.
3Enter 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.
3Guruprasad L's blog post's answer for me.
- Create file
/etc/NetworkManager/conf.d/20-connectivity-debian.conf(you'll need root or sudo). Add the following lines as recommended by Guruprasad:
[connectivity] uri= response=NetworkManager is online interval=300Restart the network manager with
service network-manager restart(will need sudo or root again).
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.
2For 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.
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.
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 wlan0If 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 (Replace 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).