19

I'm running Arch Linux on my netbook. My school have an open Access Point and we must sign into the network via a page which we are redirected to when we try to open whatever website if we are not connected.

It works on my Android Smartphone. It works on Windows. It should also works on Linux since my teacher is able to connect to it (he's running Ubuntu).

I connect to the access point with wifi-menu to generate a netctl profile. I am connected but I am not redirected to the login page, and when I type the address (taken from my phone) it don't find the server... I tried disabling IPv6, but nothing change...

3
  • It's running a service like networkmanager on your system?
    – mavillan
    Sep 6, 2013 at 6:47
  • I don't think so... I have netctl which use wpa_supplicant... I discovered that there's also another network, which is securised by WPA. I can put login using my credentials that I should put in the login page for the open network, but I still can't access the web... Tried with my phone : it works... Sep 6, 2013 at 7:28
  • It sounds like this could be an DNS issue. Can you confirm if you can access a remote host directly via an IP address? Sep 6, 2013 at 19:14

8 Answers 8

21

If redirect page does not load, and reconnecting does not fix the issue, then the easiest next step is to address the router directly.

Try 192.168.1.1. That is the most common default address, and is often not changed.

Addressing the router should send you to the redirect page.

2
  • 2
    Or 10.10.1.1, which worked in my case.
    – Ray
    Jul 1, 2017 at 21:55
  • In my case it was 10.10.0.1 ("Mikrotik hotspot") Feb 11, 2019 at 9:45
12

What you describe is called a captive portal. They are typically used for authentication on Wi-Fi hotspots, but can be used to control wired network access as well.

There are several ways to implement a captive portal:

  • HTTP Redirection

    In this case, DNS queries from unauthenticated clients are resolved as normal. However, when the browser makes a HTTP request to the resolved IP address, the request is intercepted by a firewall acting as a transparent proxy. The client HTTP request is forwarded to a server in the local network which issues a server-side redirect with a HTTP 302 Found status code, which will redirect the client to the captive portal.

  • DNS Redirection

    In DNS based redirection the firewall ensures that only the DNS server(s) provided by DHCP may be used by authenticated clients. The firewall could also redirect any DNS queries from unauthenticated clients to the local DNS server. This DNS server will in turn return the IP address of the captive portal as a response to all DNS lookups made by unauthenticated clients.

  • IP Redirection

    In redirection working on the IP layer a router performs Destination Network Address Translation (DNAT) to reroute packets originating from an captive hosts to the captive portal. In cases where the captive portal software runs on the router itself, the packets are directed to an internal interface instead. Packets headed from the captive portal to the host get in turn their source address rewritten so that they would appear to originate from the original destination.

When troubleshooting captive portal issues, the first step would be to identify what type of redirection is in use and at which point the redirection fails. The right tool for this job is a packet analyzer, such as Wireshark. Keep in mind though, that your school's IT policy might prohibit the use of packet sniffers on the local network as such tools could easily be used to invade the privacy of others on an unencrypted network.

You could also consult the tech support at your school. They would be aware of the captive portal configuration on the local Wi-Fi network, and especially if faculty members are using Linux they probably could help in pinpointing the source of the problem.

3
  • 1
    @Shywim My post is not much of an answer, but it's hard to give specific advice without knowing more about the specific captive portal solution used at your school. Sep 6, 2013 at 19:02
  • That's fine, it is very instructive. My problem seems to be different (I have the same problem with other networks), but I'll leave this question and accept your answer. :) Sep 9, 2013 at 9:43
  • 1
    I would find it useful if this answer were edited to include information about what to look for in the packet traffic and how to respond accordingly. Dec 11, 2014 at 19:11
11

In my case being signed in to Chrome was getting in the way. When I opened up an incognito window and went to a random webpage the redirection worked. I got this idea from a post on an Arch Linux thread.

3
  • 4
    I tried a few things and none worked, but this one did!
    – Wojtek
    Nov 27, 2019 at 11:01
  • 2
    Ah-HA! This was the only answer which worked for my Lubuntu laptop. To be clear, I had to open a website which I had never visited before in an incognito window. Worked like a charm!
    – Ben Blank
    Dec 25, 2021 at 1:49
  • Didn't work for me. I am using Ubuntu 22.04
    – Vikas Goel
    Feb 9 at 18:03
8

After none of the above answers got me into "Wifi on ICE" on a German train, I ran into https://gist.github.com/martinvirtel/5d35ff7a82fd4c26d502e37682a6d101. Type route -n to see the IP address of the gateway, such as

0.0.0.0         172.18.0.1      0.0.0.0         UG    600    0        0 wlp0s20f3

Then look for a bridge (br-) with the same prefix, such as

172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-50e6082d8b75

Delete the bridge:

sudo ifconfig br-50e6082d8b75 down
sudo brctl delbr br-50e6082d8b75

On Ubuntu this requires the bridge-utils package.

3
  • 1
    This just worked for me also on WIFI on Db, life saver - thanks!
    – jfy133
    Sep 30, 2021 at 9:30
  • This is what finally worked for me, had to delete five extraneous bridges and then the captive portal worked perfectly.
    – labarna
    Sep 17, 2022 at 16:44
  • Since bridge-utils may not be installed always, one can also delete it from Advanced Network Configuration. However this did not work for me.
    – Vikas Goel
    Feb 9 at 18:02
6

The hotel was using the 172.17.x.x network and so was my installation of docker-- since no clients were requiring me to use docker instances at present, I uninstalled it and the login redirect for signing in stopped having problems.

2
  • This was my problem, bad idea to use private ip range for captive portal. 172.17/16 routed out wrong interface. Thanks.
    – Pieter
    May 23, 2020 at 23:03
  • The same on me. My hotel is trying to direct me to a portal at 172.17.x.x. After running ip link delete docker0 I can load this page successfully Jan 1, 2022 at 11:07
4

generally the router also hosts the captive portal (but not always). If you connect to it you will generally be presented with the captive portal. To determine what the address is for the captive portal you can either look and remember the address on a device that properly redirects or you can run route -n and select the address (under Gateway) that corresponds to the default route (the top row - 0.0.0.0/0).

Type that address (the default router address) into a browser window and hopefully you should be presented with the captive portal.

0

I had a Docker bridge network that was clobbering the IP address of the gateway (see cayhorstmann's answer for info on how to figure that out).

I couldn't use cayhorstmann's answer because I couldn't install bridge-utils, but I ran docker network prune and that was able to free up that bridge network. It might not work if you have containers actively using that network, but at the very least you don't have to completely uninstall Docker.

New contributor
Tyler Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
-1

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.

1
  • 1
    That is a URL used by NetworkManager to test whether there is internet connectivity. It doesn't help with signing on/authenticating with the network in the first place, especially when not using GNOME.
    – JigglyNaga
    Oct 27, 2018 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.