So what’s going on when we connect to Wifi at the local cafe? We take out our notebook and connect to the Wifi, and then when we try and access a URL, we get an intermediate page instead. The page is maybe asking for a password, or for us to put in our email, and acts as a gatekeeper to the online world. Note that not all places do that – this post is about those that to intermediate access.
When we connect to the local Wifi, a protocol called DHCP assigns us with an IP address. It also lets us know about the local name servers to use for domain name resolution, and tells us what gateway to use to connect to the outside world.
At this point we are connected to the local network, but we haven’t yet attempted to access a web page on a remote site. What happens when we do is that a connection attempt to the site is made through our gateway router. The router looks at the IP address/MAC address on the connection and intercepts any web traffic attempts made. The gateway will issue an HTTP 302 redirect instead, to send you over to a different web site responsible for displaying the login page/disclaimer page or whatever. Once you have jumped the hoops that the Wifi providers place in front of you, your IP/MAC address is whitelisted on the Gateway router, and you are able to access the internet.