sharland
Posts: 8
Joined: Thu Aug 14, 2014 8:19 pm
Location: Oxford
Contact: Website

WiFi Captive Portal

Sat Aug 16, 2014 2:52 pm

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

fruitoftheloom
Posts: 20495
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: WiFi Captive Portal

Sat Aug 16, 2014 7:01 pm

Retired disgracefully.....

sharland
Posts: 8
Joined: Thu Aug 14, 2014 8:19 pm
Location: Oxford
Contact: Website

Re: WiFi Captive Portal

Sun Aug 17, 2014 10:23 am

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.

User avatar
default_user8
Posts: 658
Joined: Mon Nov 18, 2013 3:11 am

Re: WiFi Captive Portal

Sun Aug 17, 2014 11:05 am

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.
Two heads are better than one, unless one's a goat head.

sharland
Posts: 8
Joined: Thu Aug 14, 2014 8:19 pm
Location: Oxford
Contact: Website

Re: WiFi Captive Portal

Tue Aug 19, 2014 3:10 pm

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.

comdif
Posts: 3
Joined: Tue Jan 03, 2017 8:31 pm

Re: WiFi Captive Portal

Sun Mar 19, 2017 11:03 pm

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.

chris57100
Posts: 522
Joined: Wed Sep 12, 2012 7:23 pm
Location: Thionville
Contact: Website

Re: WiFi Captive Portal

Tue Sep 19, 2017 11:05 am

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
Raspberry Pi Home Server : http://www.pihomeserver.fr
Software and electronic tutorials : Samba, Airplay, CUPS, Time machine, Nginx, Owncloud, rTorrent, Wordpress, etc.
Full Wi-Fi hotspot installation on a RPi 3 including a captive portal and freeradius management: https://github.com/pihomeserver/Kupiki-Hotspot-Script

Return to “Networking and servers”