First, some good news. Can you use a Raspberry Pi 3 (or other device with one Ethernet port and one Wi-Fi radio) to run a captive portal using openNDS? Absolutely. It’s trivially easy to do. I’ve done it, and I’ll describe how to do so here.
Now the bad news. Should you do so? Your experience may vary. @bluewavenet‘s point about hardware power and capabilities is a valid one. While it will work, if your hardware is low-powered then the performance may not be as good as you desire. I certainly experienced sluggish response when using my test equipment (see the next paragraph), and if I was going to deploy openNDS in production I’d use something much beefier to host it.
I can’t find my Raspberry Pi 3, but I do have something with equivalent connectivity (1x Ethernet, 1x Wi-Fi): a VoCore2 Ultimate. It’s a cracking little device which has lived in my kit bag for 10 years. It’s currently running OpenWRT 25.12.2.
After installing and configuring openNDS with the right interface name, this is what I saw when I connected my laptop to the SSID broadcast by the VoCore2:
The VoCore2’s configuration is thus:
- Ethernet - WAN interface, WAN firewall zone, DHCP client
- Wi-Fi - radio interface configured as AP, LAN firewall zone, DHCP server
NOTE: the rest of this post shows how openNDS can be installed and configured in one deployment scenario. It is not a guaranteed recipe for every scenario; the reader is expected to be able to understand the configuration files and concepts and translate them for other deployment scenarios. In addition, this post does not discuss more advanced openNDS configuration such as authentication; this post is solely about how to get openNDS working on a device with 1x Ethernet port and 1x Wi-Fi radio.
Here are the contents of the configuration files:
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
config interface 'wan'
option device 'eth0.1'
option proto 'dhcp'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 2 6t'
config interface 'lan'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
/etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ignore '0'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/odhcpd.leases'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
option piodir '/tmp/odhcpd-piodir'
option hostsdir '/tmp/hosts'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/10300000.wmac'
option channel '1'
option band '2g'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'openwrt'
option encryption 'psk2'
option key 'password'
/etc/config/opennds contains the interface name shown in the output of ifconfig:
config opennds
option enabled 1
option gatewayinterface 'phy0-ap0'
So there you go. As indicated at the start of this post, you absolutely can use a low-powered device with limited connectivity to host an instance of openNDS... as long as you're willing to tinker and willing to put up with potentially sub-optimal performance.