Next generation WifiDog implemented in Lua.
Clone or download
zhaojh329 Fix
Signed-off-by: Jianhui Zhao <>
Latest commit bfbfe26 Nov 27, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
files logout request needs respond Oct 26, 2018
src Lua: init Jul 22, 2018
.gitignore Initial commit Nov 10, 2017 Fix Nov 27, 2018 chmod 644 Mar 15, 2018 chmod 644 Mar 15, 2018
LICENSE Change license to LGPL2 Mar 3, 2018
Makefile Reimplemented in lua-copas Oct 21, 2018 Update README Oct 24, 2018 Update README Oct 21, 2018


license PRs Welcome Issue Welcome Release Version

Next generation WifiDog

WifiDog-ng is a very efficient captive portal solution for wireless router which with embedded linux(LEDE/Openwrt) system implemented in Lua.

Keep Watching for More Actions on This Space


  • Written in Lua, so development is very efficient
  • Use ipset and writing kernel module to implement authentication management instead of using iptables to create firewall rules
  • Support roam
  • Code structure is concise and understandable


UCI Config options

Section gateway

Name Type Required Default Description
enabled bool no 0 Whether to enable wifidog
dhcp_host_white bool no 1 dhcp mac is whitelist
id string no Gateway id. If not set, the mac address of the ifname will be used
interface Openwrt interface no lan The device belong to the interface to listen by wifidog
port port number no 2060 port to listen by wifidog
ssl_port port number no 8443 ssl port to listen by wifidog
ssid ssid no Used for WeChat
checkinterval seconds no 30 How often the gateway will ping the auth server
temppass_time seconds no 30 Temporary pass time

Section server

Name Type Required Default
host string yes no
port port number no 80
ssl bool no 0
path string no /wifidog
login_path string no login
portal_path string no portal
msg_path string no gw_message.php
ping_path string no ping
auth_path string no auth

Section validated_user

Name Type Description
mac string A macaddr
comment string A comment

Section validated_domain

Name Type Description
domain string Can be a domain or ipaddr
comment string A comment


Gateway heartbeating (Ping Protocol)


To this the auth server is expected to respond with an http message containing the word "Pong".





Auth confirm


The response of the auth server should be "Auth: 1" or "Auth: 0"



The response of the auth server should be "token=xxxxxxx" or other.

Temporary pass


Test Server


Kick off the term

wget "http://lanip:2060/wifidog/ctl?op=kick&mac=0C:1D:AF:C4:DB:FC" -O /dev/null

Relaod config

wget "http://lanip:2060/wifidog/ctl?op=reload" -O /dev/null

Show device

ipset list wifidog-ng-mac



If you would like to help making wifidog-ng better, see the file.

QQ group: 153530783

If the project is helpful to you, please do not hesitate to star. Thank you!