Le projet nodogsplash est une solution de portail captif légère et hautement configurable. Il s'intègre bien à RaspAP et est recommandé par rapport à d'autres méthodes. Aucun changement de configuration n'est nécessaire avec RaspAP, mais vous devrez modifier certains paramètres par défaut dans la configuration nodogsplash. Ce guide étape par étape suppose que vous avez déjà installé RaspAP, soit avec le programme d'installation rapide, soit avec les instructions de configuration manuelle.
Remarque : Cette procédure pas à pas est fournie uniquement à titre de courtoisie ; il n'y a pas de support pour NDS ou toute intégration avec ce projet.
Commencez par mettre à jour votre RPi avec les dernières informations sur le paquet :
sudo apt-get update
Avec notre gestionnaire de paquets à jour, installez une dépendance requise par nodogsplash :
sudo apt-get install libmicrohttpd-dev
Ensuite, clonez le référentiel GitHub nodogsplash dans votre répertoire personnel :
cd ~/
git clone https://github.com/nodogsplash/nodogsplash.git
Nous pouvons maintenant compiler nodogsplash à partir de la source :
cd nodogsplash
make
sudo make install
With nodogsplash installed in the Pi's system, we will make two small changes to its configuration. The nodogsplash GatewayInterface should be set to the interface RaspAP runs on (wlan0 is the default). You will also need to change the GateWayAddress to 10.3.141.1.
Remarque : si vous avez modifié la configuration par défaut de RaspAP, assurez-vous que ce paramètre reflète vos modifications, sinon le portail captif ne fonctionnera pas correctement.
sudo nano /etc/nodogsplash/nodogsplash.conf
# GatewayInterface is not autodetected, has no default, and must be set here.
# Set GatewayInterface to the interface on your router
# that is to be managed by Nodogsplash.
# Typically br-lan for the wired and wireless lan.
#
GatewayInterface wlan0
#
# Parameter: GatewayAddress
# Default: Discovered from GatewayInterface
#
# This should be autodetected on an OpenWRT system, but if not:
# Set GatewayAddress to the IP address of the router on
# the GatewayInterface. This is the address that the Nodogsplash
# server listens on.
GatewayAddress 10.3.141.1
Save and quit out of the editor by pressing Ctrl+X and then pressing Y and finally Enter.
We are now ready to start up the software. This can be done by simply executing the binary with sudo nodogsplash. However, we'll make things a bit easier by adding a systemd service provided by the project. Copy the service control file and enable it:
sudo cp ~/nodogsplash/debian/nodogsplash.service /lib/systemd/system/
sudo systemctl enable nodogsplash.service
Ensuite, démarrez le service et vérifiez son état :
sudo systemctl start nodogsplash.service
sudo systemctl status nodogsplash.service
Vous devriez voir une sortie similaire à la suivante :
● nodogsplash.service - NoDogSplash Captive Portal
Loaded: loaded (/lib/systemd/system/nodogsplash.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-02-11 09:19:44 GMT; 34min ago
Main PID: 10539 (nodogsplash)
Tasks: 4 (limit: 1599)
Memory: 1.7M
CGroup: /system.slice/nodogsplash.service
└─10539 /usr/bin/nodogsplash
Feb 11 09:19:44 raspberrypi systemd[1]: Starting NoDogSplash Captive Portal...
Feb 11 09:19:44 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:44 2020][10538](src/main.c:496) Starting as daemon, forking to background
Feb 11 09:19:44 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:44 2020][10539](src/main.c:271) Detected gateway wlan0 at 10.3.141.1 (dc:a6:32:3d:ff:9d)
Feb 11 09:19:44 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:44 2020][10539](src/main.c:275) MHD Unescape Callback is Disabled
Feb 11 09:19:44 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:44 2020][10539](src/main.c:305) Created web server on 10.3.141.1:2050
Feb 11 09:19:44 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:44 2020][10539](src/main.c:319) Using config options for FAS or Templated Splash.
Feb 11 09:19:44 raspberrypi systemd[1]: Started NoDogSplash Captive Portal.
Feb 11 09:19:46 raspberrypi nodogsplash[10538]: [5][Tue Feb 11 09:19:46 2020][10539](src/fw_iptables.c:382) Initializing firewall rules
Note: The captive portal may be stopped with sudo systemctl stop nodogsplash.service or disabled completely with sudo systemctl disable nodogsplash.service.
Connectez un client au point d'accès de RaspAP. Vous devriez maintenant voir l'écran du portail captif de nodogsplash :
Facultatif : vous pouvez personnaliser l'écran du portail captif en modifiant les fichiers situés dans/etc/nodogsplash/htdocs/.
La documentation complète de nodogsplash est disponible ici.