Nodogsplash 訪客認證

Nodogsplash offers a simple way to provide restricted access to an internet connection. It is derived from the codebase of the Wifi Guard Dog project. Nodogsplash is released under the GNU General Public License.( Github)

簡單來講,經過Nodogsplash能夠把openwrt的路由器變成一臺廣告發射機,別人一連上你的wifi就得看了你的廣告才能上網,吼吼吼~
目前的方法主要是把訪客網絡和2.4G網絡混在一塊兒,這樣並非一個好辦法,經過把訪客網絡分離出來能夠把Nodogsplash掛在訪客網絡上。
好吧,我知道我本身也說不清楚到底什麼意思,直接看代碼比較直接。git


  1. 增長lan接口,好比lan1
mynetwork="lan1"
myip="XXX.XXX.XXX.XXX"
mynetmask="255.255.255.0"
uci set network.${mynetwork}=interface
uci set network.${mynetwork}.proto=static
uci set network.${mynetwork}.ipaddr=$myip
uci set network.${mynetwork}.netmask=$mynetmask
uci set network.${mynetwork}.ifname=$mynetwork
uci set network.${mynetwork}.type=bridge
uci set network.${mynetwork}.force_link=1
uci set network.${mynetwork}.ip6assign=60
  1. 修改wireless

這裏的訪客網絡是@wifi-iface[2]github

uci set wireless.@wifi-iface[2].network="${mynetwork}"
  1. 新增防火牆
uci add_list firewall.@zone[0].network=${mynetwork}
  1. 開啓dhcp
uci set dhcp.${mynetwork}=dhcp
uci set dhcp.${mynetwork}.interface=${mynetwork}
uci set dhcp.${mynetwork}.start=100
uci set dhcp.${mynetwork}.limit=150
uci set dhcp.${mynetwork}.leasetime=12h
  1. uci commit
  2. GatewayInterface br-lan1
相關文章
相關標籤/搜索