As a project I am building my own captive portal web pages for "unauthenticated" users. Those are users that have not hit a button on my captive portal page. I want this to be out of band (like a packetfence deployment option), so that my Linux machine is not acting as a router / proxy.
To do this I need to know HOW the device, in my case an iPhone running iOS 8, is redirected to the captive portal page.
This is what I think should happen:
- iPhone connects to the Wi-Fi
- DNS points at my Linux machine which resolves all requests with the IP of itself
- The Linux machine has a web server that responds to everything on port 80, and redirects everything using the HTTP Location: header to a page with the content and a button
- The button is pressed and the user's mac address is added to "something", and from then on the DNS does proper resolution (??) or maybe iptables redirects DNS requests to another public DNS host (??)
I have been through this site and Google for a few days now have even tried to look at the Packetfence code (I'm not a perl developer), I need to confirm if my process above is correct, or a bullet point list of correct steps. I have had a look at this serverfault post, it's the detail on how the redirect happens, and more importantly how to NOT have the redirect happen once the user is "authenticated".
I appreciate if anyone has this knowledge to fill in the gaps or point me at a web site that has the "how / what does the redirect - dns / dhcp / http / iptables).
The problem I am trying to solve is to articulate the technical process of how this works, expanding on other posts on this site which say things like "the first request should be redirected". My question is... how / what tools do I need to do that.