Openwrt-wifidog Use of Luci Certification

Source: Internet
Author: User
Tags lua php and php and mysql

OpenWrt implementation of the portal certification (Web authentication) to introduce the OPENWRT environment to achieve WiFiDog authentication method, at the end of the article I wrote "Some people may also ask, can you integrate these scripts into the router, my answer is yes, as long as your script does not function much, The problem should be small, but the risk of doing so is relatively large, the load of the route is relatively high, resulting in the operation of the route will be very unstable, and even often crash, this is the result of my hands-on practice, so I do not recommend this.

Tossing between the sudden an idea, since OpenWrt have uhttpd and Luci as a Web service to provide graphical configuration interface, then can the WiFiDog certification page integration into the Luci it. Before the author has tested the WiFiDog Web Authentication page integrated into the OPENWRT, the implementation method is to use the traditional LMNP scheme, that is, install Nginx, PHP and MySQL on OpenWrt, deploy WiFiDog certification services. But the effect is very unsatisfactory, openwrt will be in high load state for a long time, even affect the user's normal internet access, stability is not guaranteed, often crashes, so this program is not advisable, and I do not recommend this reason.

The OpenWrt integrates uhttp and Luci as a Web service to provide a graphical configuration interface. UHTTPD is a lightweight Web server, and Luci is written in a lightweight scripting language like Lua, with excellent performance, which is why OpenWrt chooses them,

After a detailed study of the documentation and related Materials of Lua and Luci, the idea was finally realized, and the program was compiled into IPK (download at the end of the article), it should be explained that WiFiDog need to install itself.

After the installation is complete, the default login address for WiFiDog is http://192.168.1.1/cgi-bin/luci/login/(the routed LAN IP is not 192.168.1.1 to be modified by itself), the default username is root, the password is admin, Note You must be logged in to be successful when WiFiDog is turned on. If you want to add users and change the password, modify the/etc/wifidog.auth file, the format is Username:password, in the middle with a half-width colon separated, each user occupies a row.

Login interface

About the installation after the WiFiDog configuration, I added the wifidog.conf.example in IPK, after the installation is located in the/etc/directory, but still need to be based on your environment for the corresponding configuration, need to configure the parameters have Externalinterface, Gatewayinterface, gatewayaddress, where Externalinterface refers to the WAN interface of your route, and if it is a VLAN interface, populate the VLAN interface Gatewayinterface refers to the interface of your routed LAN, typically br-lan;gatewayaddress refers to the IP address of your routed LAN. Key configuration Authserver has been provided, if you want to know the configuration details of Authserver, you can refer to this blog related articles.

If you have HTML+CSS or even div+css programming basics and experience, you can customize the login Authentication page, whose HTM page is located under/usr/lib/lua/luci/view/wifidog/folder, CSS and other resource files are located in/www/wifidog/ Folder.

The stability of the test has been improved a lot. However, I still recommend that if you have more than 10 WiFi access users, a separate authentication server is still necessary. In addition, special reminder, if your wifi is open, Luci configuration Login interface will also be exposed, if your root password is too simple, there will be a security risk.

Attachment Download:

LUCI-APP-WIFIDOG-AUTHMINI_1.0-1_ALL.IPK (full platform Universal)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.