Ask HN: How do I set up a WiFi internet gateway similar to retailers or hotels?
I received a TP-Link Omada AC1200 Gigabit Wireless Access Point for Christmas and would like to use it to provide an open WiFi connection for people to use in my area.
I would like to have this network isolated from my existing home networks and have a RPI2 that I would prefer to use for the server but am willing to purchase another router if need be.
What I would like is to have a logon page that anyone wishing to access the internet must load in their browser and agree to "MY" T&C, similar to what many hotels and chain restaurants have.
I have searched for information on this but I am coming up short on specific keywords to narrow down the results. Any help or direction in where to find such information would be greatly appreciated.
Thank You.
6 comments
[ 197 ms ] story [ 3089 ms ] threadMy company provides captive portals for guest networks as a low cost hosted service:
https://www.stad.io
I recommend the Cisco Meraki Go Access Points, because they are low cost and easy to setup and manage.
https://www.amazon.com/Meraki-Go-Indoor-WiFi-AP/dp/B07GX1RHS...
Hope that helps.
I have a number of articles to read now on turning a RPi into a "Captive Portal.
Thanks for the fast response!
If you go the RPi route, you may find the following script helpful. This will bridge the 3rd party dongle to the local network, isolate devices from communicating to private network IPs, and forward HTTP/S traffic through the Squid HTTP proxy service. (sorry about the formatting):
#!/bin/bash
set -e if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 fi
# Set the proxy interface based on the presence of wlan0 or not
if [ -e "/sys/class/net/wlan0/operstate" ] ; then PROXY_INTERFACE=wlan0 else PROXY_INTERFACE=eth0 fi
PROXY_HTTP=3128
PROXY_HTTPS=3129
PROXY_NETWORK=`ip address show $PROXY_INTERFACE | grep 'inet .* brd ' | head -1 | sed -e 's/inet \(.\) brd.$/\1/' | sed -e 's/ //g'`
# Allow traffic to the proxy's network
iptables -A FORWARD -d ${PROXY_NETWORK} -j ACCEPT
# Drop traffic forwarded to all other class A, B, and C private networks
iptables -A FORWARD -m iprange --dst-range 10.0.0.0-10.255.255.255 -j REJECT
iptables -A FORWARD -m iprange --dst-range 172.16.0.0-172.31.255.255 -j REJECT
iptables -A FORWARD -m iprange --dst-range 192.168.0.0-192.168.255.255 -j REJECT
# WiFi AP Only; Bridge WLAN to eth0
if [ $PROXY_INTERFACE = "wlan0" ]; then iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
fi# Let local Squid get out to HTTP/S
iptables -t nat -A PREROUTING -s localhost -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -s localhost -p tcp --dport 443 -j ACCEPT
# Forward all HTTP/S to Squid
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port $PROXY_HTTP
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port $PROXY_HTTPS
# drop direct connections to the squid proxy
iptables -t mangle -A PREROUTING -p tcp --dport $PROXY_HTTP -j DROP
iptables -t mangle -A PREROUTING -p tcp --dport $PROXY_HTTPS -j DROP
My current idea is to invert the network connections and use the wireless to connect the RPi to my internal internet connection and the wired connection to serve out the internet to my neighbors. The main reason for this is the tp-link WIFI antenna I got for Xmas comes with a POE injector which will make outdoor installation much easier and I am assuming it will have an increased range over the built-in Rpi WIFI.
I found this Git which seems to go over the process of setting up a standard capture portal which after setting up, I am hoping will be fairly easy to swap the device IDs to achieve my goal.
https://github.com/TomHumphries/RaspberryPiHotspot