First install the WiFiDog to OpenWRT router:
OPKG Update
Opkg Install WiFiDog
WiFiDog relies on the following modules:
Iptables-mod-extra
Iptables-mod-ipopt
Kmod-ipt-nat
Iptables-mod-nat-extra
Libpthread
Because the trunk firmware update will be more frequent, will cause the direct opkg install WiFiDog installation, if you happen to not back up with the firmware corresponding Packages, you need to the http ://downloads.openwrt.org/snapshots/trunk upgrade firmware, and then install WiFiDog. I backed up a version of the Year 7 month (kernel =3.10.3-1-9da5017d589c0594e545ab00a51eecea) Packages, take it with you if you need it :
Http://openwrt.sinapp.net
If your router is not an officially supported version of OPENWRT, then you need to compile the firmware yourself. after make Menuconfig , select WiFiDog in the network–>captive portals .
After the installation is complete,
/etc/init.d/wifidog Enable
/etc/init.d/wifidog start
An error is thrown because we have not set the Authserver information yet. For more information on installing WiFiDog, refer to:http://wiki.openwrt.org/doc/howto/wireless.hotspot.wifidog
Install Auth Server below, according to the official statement:
Authpuppy is the next Generation authentication server for Wifidog networks.
Source Documents <http://www.authpuppy.org/>
But seemingly this WiFiDog and authpuppy have been N long not updated ...
Authputty is required to install apache2, php5 and MySQL. Details are here:http://www.authpuppy.org/doc/Getting_Started (Windows Edition point here ).
After successful installation, access to authpuppy will require you to set up some database information, you can see the home page after all settings are complete:
Of course, we also need to set up an administrator's account.
Enter Manage plugins,Install apauthlocaluserplugin, remember to enable this plugin.
Then, click Manage NodesTo change the status of the default node to deployed. This GW (Gateway) ID default is used when configuring wifidog.conf.
Here, the basic configuration of the authpuppy is complete.
Below back to the router, edit wifidog.conf, in general, we then configure externalinterface,gatewayinterface and authserver these three items will be available, other default. Here is my configuration:
GatewayidDefault # Note that this ID must be consistent with Authpuppy's GW ID
# Parameter:externalinterface
# Default:none
# Optional
#
# Set this to the external interface (the one going out to the inernet or your larger LAN).
# typically vlan1 for OpenWrt, and eth0 or ppp0 otherwise,
# normally autodetected
Externalinterface eth0 # Physical interface of router extranet
# Parameter:gatewayinterface
# Default:none
# Mandatory
#
# Set this to the internal interface (typically your WiFi interface).
# typically Br-lan for OpenWrt, and eth1, Wlan0, ath0, etc. otherwise
Gatewayinterface wlan0 # Physical interface of router intranet
Authserver {
Hostname 192.170.1.104
Sslavailable No
Path/
Checkinterval 60
ClientTimeout 5
Firewallruleset Global {
}
Firewallruleset Validating-users {
Firewallrule Allow to 0.0.0.0/0
}
Firewallruleset Known-users {
Firewallrule Allow to 0.0.0.0/0
}
Firewallruleset Unknown-users {
Firewallrule allow UDP port 53
Firewallrule allow TCP port 53
Firewallrule Allow UDP port 67
Firewallrule Allow TCP port 67
}
Firewallruleset Locked-users {
Firewallrule block to 0.0.0.0/0
}
Note that this Interface is a physical interface, not the Interface seen in the OpenWRT Web interface below . Note that this is not the following:
Can see my Interface inside there is no wlan0 such as the option,/etc/config/network inside also can't see.
[Email protected]:~# cat/etc/config/network
Config interface ' loopback '
Option ifname ' lo '
Option Proto ' Static '
Option ipaddr ' 127.0.0.1 '
Option netmask ' 255.0.0.0 '
Config globals ' globals '
Option Ula_prefix ' fd09:fd03:490d::/48′
Config interface ' LAN '
Option Proto ' Static '
Option ipaddr ' 192.168.1.1 '
Option netmask ' 255.255.255.0 '
Option Ip6assign ' 60 '
Option _orig_ifname ' eth0′
Option _orig_bridge ' false '
Config interface ' WAN '
Option Proto ' DHCP '
Option _orig_ifname ' gretap0′
Option _orig_bridge ' false '
OPTION ifname ' eth0′
Before I set Externalinterface and Gatewayinterface with Gretap0 and eth0 , No. Not in the opposite way. Search the Internet, find the following method to obtain physical interface:
[Email protected]:~# ls-l/sys/class/net
lrwxrwxrwx 1 root root 0 Jan 1 1970 eth0. /.. /devices/platform/ag71xx.0/net/eth0
lrwxrwxrwx 1 root root 0 Jan 1 1970 lo. /.. /devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 2 15:58 wlan0. /.. /devices/platform/ar933x_wmac/net/wlan0
Source Documents <http://unix.stackexchange.com/questions/57309/ How-can-i-tell-whether-a-network-interface-is-physical-device-or-virtual-alia>
OK, originally my side also has wlan0 this interface , found after added on the wifidog.conf . Restart WiFiDog, success.
Other than that:
You can also run WiFiDog in foreground/Debug mode:
Wifidog-f-D 7
-F means to run in foreground (does not become a background daemon)
-D 7 increases Debug output level to the maximum
Reproduced OpenWrt use WiFiDog to implement mandatory authentication for WiFi hotspots | Half an orange.