Setting up a Wi‑Fi captive portal in an air‑gapped system

This setup was used as a demo unit at a conference to provide insight into the cybersecurity concerns around public Wi‑Fi networks. The project emulates a captive portal‑based Wi‑Fi network, such as ones found in Hotels, Airports, and Coffee shops. The setup is completely air‑gapped and does not require any form of internet connection to function.

Products used

Process

Initial Setup

Configuring the devices

FortiGate has a built‑in captive portal that we will be using. The issue is that FortiGate will not proceed with the captive portal unless it is connected to the internet. Hence, this won’t work for an air‑gapped system. This is where the Raspberry Pi comes in. It acts as a gateway and essentially fakes a network connection to allow the FortiGate to pass the mobile device “Captive Network Assistant” (CNA) check and display the captive portal.

Configuring the Raspberry Pi

Configuring the FortiGate and FortiAP

After completing the steps above, a Wi‑Fi network will appear that any mobile device can join. The device will be redirected to the captive‑portal page; if credentials are entered, the user is taken to the “Login Failed” page.

Note on Samsung devices: Samsung’s Knox suite uses a hard‑coded CNA address, so the standard captive‑portal flow does not trigger. To support those devices, add a DNS override for the Samsung CNA host:

$ sudo nano /etc/dnsmasq.conf
# Add:
address=/www.samsung.com/192.168.10.1
$ sudo systemctl restart dnsmasq

This forces Samsung phones to resolve the CNA check to the Pi, allowing the captive‑portal to appear.