QUEST: DietPi with HotSpot and Captive Portal / DNS redirect

Hi All,

I have a question how to setup something like a Captive Portal on DietPi. :wink:

My aim is to have an open HotSpot and every user who connect to the HotSpot, should be redirected to a static website (on the RPi)

What I have done so far, is to install the HotSpot from DietPi Software catalog. This was working quite fine and I was able to use the DietPi HotSpot. No issues on that. Next step would be to setup some kind of Captive Portal or DNS redirection to a website hosted on the RPi it selves. And that’s where I stuck now. I tried using the following guide, but somehow it was not working.

https://pimylifeup.com/raspberry-pi-captive-portal/

I’m still able to connect to the HotSpot but than I did not get redirected to my Captive Portal website. Seems my mobile clients are not recognizing that there is something like a Captive Portal available. Therefore my question would be, if someone has an idea or guide that can be used :slight_smile:

Many thanks in advance

I think it’s Nodogsplash that features in that article and yes this would be a great addition to the DietPi software selection. I tried installing as instructed but am not seeing the redirect to splash page, expect have missed a configuration element.

What’s the process for including new software?
thanks

well there is no real process as DietPi is maintained by a single person only. There is quite a lot of work and not everything can be done at some time. But you can could create FeatHub entry and if there are enough votes, it might get implemented :wink: .

https://dietpi.com/forum/t/feathub-vote-for-or-add-your-requests-for-dietpi/2931/1

Hi Joulinar, Any further development on your captive portal project? I will also like to install captive portal on my Raspberry Pi running DietPi, but I will have external wireless AP. If coova-chilli is not in any of the repo list in DietPi, is there a way to add an external repo to then install coova-chilli?

or a recommended process to download the tar via wget and install it that way?

Thanks

no I did not followed this for long time.

In general you could try to follow coova-chilli installation guide to have it installed. In general DietPi for Raspberry Pi is nothing else than a modified Raspberry OS.

The coova chlli guide does not specify a process to be followed for Raspberry Pi or DietPi of course. The guides available are for Raspberry pie using opkg package manager and that is not supported on the DietPi and neither is there suitable repo list in there.

I thought to make a deb package from the tar.gz file available but then dbbuild is not supported on dietPi and I could not install it either.

I thought to try a simpler solution again for which there is no deb package available, NoDogSplash and I downloaded the zip, unzipped it and then tried to make i. Did not work. Installed libmicrohttpd-dev and build-essential and then I was able to do successful make and make install.

NoDogSplash works. But then my plans changed as I needed a one-legged solution with only ethernet port used in Pi with external Wireless AP and I thought I could change dhcp server to specify Pi’s eth0 address as gateway and then I do get splash page, but there is no re-routing of traffic by the Pi over to the actual gateway to send it to Internet. I could not understand as to why this will not happen, the way it happens in any L2 environment where one gateway could direct you to a better gateway and traffic flows with no notice by the user.

For debuild command, install the related APT package: apt install devscripts
But it is by far not the only way to create a DEB package. Alternatively you can simply use dpkg-deb -b /path/to/pkgdir which is available OOTB on every APT/DEB-based distro.

Thanks MichaIng .

So based on your recommendation, we can install a popular coova-chilli splash page solution by building a deb package and then installing it.

With an external VLAN capable Wireless AP (and this could be more than one to cover bigger area or more density), and using just the single wired ethernet port, running subinterfaces / VLANs ( example below), can we assume that in absence of vlan configuration option under dietpi-config, VLAN configuration done via CLI, will not be overwritten with new version of the dietPI?

https://engineerworkshop.com/blog/raspberry-pi-vlan-how-to-connect-your-rpi-to-multiple-networks/

Thank you and keep doing good work. I had donated some money towards the project a month ago or so and I will donate bit more in a week (when paycheck is received :slight_smile:.

Looks like Coova-Chilli requires a freeradius server as a backend, but NoDogSplash (NDS) does not for simple use case, where Captive portal splash page can have an embedded username and password and then a local users file to hold these username / password.

I might revisit this in few days as I have some other urgent project to work on. Here is someone talking about latest use of NDS on RPi and that latest version is good to use.

https://github.com/nodogsplash/nodogsplash/issues/419