Captive Portal on OpenWrt

$ opkg install nodogsplash
$ uci set nodogsplash.@instance[0].enabled=1
$ uci commit
$ /etc/init.d/nodogsplash start
$ /etc/init.d/nodogsplash enable
$ vi /etc/nodogsplash/htdocs/splash.html

  <form method='GET' action='$authaction'>
    <input type='hidden' name='tok' value='$tok'>
    <input type='hidden' name='redir' value='$redir'>
    <input type='submit' value='开始上网'>
  </form>


网页效果

$ ndsctl status
==================
NoDogSplash Status  
====
Version: 0.9_beta9.9.9  
Uptime: 0d 0h 7m 30s  
Gateway Name: OpenWrt Nodogsplash  
Managed interface: br-lan  
Managed IP range: 0.0.0.0/0  
Server listening: 192.168.1.1:2050  
Splashpage: /etc/nodogsplash/htdocs/splash.html  
Traffic control: no  
Total download: 3088 kByte; avg: 54.9022 kbit/s  
Total upload: 1118 kByte; avg: 19.8782 kbit/s  
====
Client authentications since start: 1  
Current clients: 1

Client 0  
  IP: 192.168.1.196 MAC: xx:xx:xx:xx:xx:xx
  Added:   Sun Jul 17 10:56:13 2016
  Active:  Sun Jul 17 11:03:11 2016
  Active duration: 0d 0h 6m 58s
  Added duration:  0d 0h 6m 58s
  Token: 8aef5a99
  State: Authenticated
  Download: 3049 kByte; avg: 58.3564 kbit/s
  Upload:   1107 kByte; avg: 21.1965 kbit/s

====
Blocked MAC addresses: none  
Allowed MAC addresses: N/A  
Trusted MAC addresses: none  
========