Page 1 of 1

WiFi Captive Portal

Posted: Sat Aug 16, 2014 2:52 pm
by sharland
Hi,

I'm trying to see whether I can get a Pi to function as a WiFi captive portal. I've found a number of projects which involve getting the Pi setup first as an access point and then setup the captive portal software on it. Instead I would like to connect the Pi to the access point and use it to manage the captive portal.

I hesitate in throwing out a 'help me - no idea where to start' post but I am really interested in seeing if there are any packages or anything I can use to get going.

Thanks

Re: WiFi Captive Portal

Posted: Sat Aug 16, 2014 7:01 pm
by fruitoftheloom

Re: WiFi Captive Portal

Posted: Sun Aug 17, 2014 10:23 am
by sharland
Found that tutorial but it is based on the Pi acting as the access point as well. I want the Pi to connect to a separate access point and manage that. Essentially do what WifiDog http://www.wifidog.org or chillispot http://www.chillispot.org do.

Re: WiFi Captive Portal

Posted: Sun Aug 17, 2014 11:05 am
by default_user8
Here is a wiki about running Open-wrt on a raspi:
http://wiki.openwrt.org/toh/raspberry_pi

and

Here is a wiki about installing chilispot in open-wrt:
http://wiki.openwrt.org/oldwiki/wireles ... chillispot

You should be able to configure open-wrt as a gateway that connects to your hidden AP and have the raspi act as the public AP.

If all you want to do is manage chillisport or some other portal on your AP via your raspi you could run a vnc server on your pi and conncet to the AP web gui from a vnc client. Although that might not be necessay if you are able to access the web gui of the AP over WAN. You wouldnt need the raspi at all, you'd just need to forward the port of the web gui to the WAN. Not quite sure i answered your question but i hope this helps.

Re: WiFi Captive Portal

Posted: Tue Aug 19, 2014 3:10 pm
by sharland
This seems exactly like what I'm after - many thanks
default_user8 wrote:Here is a wiki about running Open-wrt on a raspi:
http://wiki.openwrt.org/toh/raspberry_pi

and

Here is a wiki about installing chilispot in open-wrt:
http://wiki.openwrt.org/oldwiki/wireles ... chillispot

You should be able to configure open-wrt as a gateway that connects to your hidden AP and have the raspi act as the public AP.

If all you want to do is manage chillisport or some other portal on your AP via your raspi you could run a vnc server on your pi and conncet to the AP web gui from a vnc client. Although that might not be necessay if you are able to access the web gui of the AP over WAN. You wouldnt need the raspi at all, you'd just need to forward the port of the web gui to the WAN. Not quite sure i answered your question but i hope this helps.

Re: WiFi Captive Portal

Posted: Sun Mar 19, 2017 11:03 pm
by comdif
As I have spend many time on this subject and searching for secrets.....
I can answer now to many questions.

Basicaly to run a captive portal you must understand that:

- Connect any device to Internet and it will send request by DHCP to a specific URL to have a Network Connectivity Status Indicator.
Right it's clear! specific "URL" mean the dhcp-server must be able to resolve an URL and need a valid and reachable DNS server, check your IPTABLE and your ISC-DHCP to point a valid DNS and you will resolve 90% of the problem
something like iptable -t nat -A PREROUTING -d 8.8.8.8/32 -j ACCEPT and
option domain-name-servers 8.8.8.8; in your ISC-DHCP conf will do the job, this will open a notification that the connexion need more informations.
- Right now if you have setting up good rules on your IPTABLES to redirect to local port 80 with a good splash captive portal page, it will work !!!! magic :-)

- Just a last tip, I don't know why some devices from apple big ch.... will not open your default splash page but will search something other and finish to 404, so you need also to setup your splash page on HTTP server as 404
for example in apache add:
ErrorDocument 404 http://splash_page_url


Finaly when client connect -> ask the dns to resolve IP to check Network Connectivity Status Indicator.
-> return URL is unreachable -> open notification or browser depending the device.

Re: WiFi Captive Portal

Posted: Tue Sep 19, 2017 11:05 am
by chris57100
Long time after : you can use a script to install hostapd, coova chilli and freeradius for a full hotspot with captive portal :
You can find it here : https://github.com/pihomeserver/Kupiki-Hotspot-Script