2015年4月

wifidog安装Oauth login for Google and Facebook on OpenWrt routers

Oauth for OpenWrt routers aims to support authentication via OAuth services (Google, Facebook...) and run on the same box with WifiDog. It is using Luci and provides an alternative to single Auth Server for WifiDog. There is no need to setup a separated machine for authentication.

How does it work?

When a new guest uses Wifi from a router to go to the Internet, he/she will be presented a login page where he/she can use his Facebook or Google accounts to log in order to have permission of using our Wifi to access the Internet. When the session of using the Internet is over, a page with a message informing that the user is unauthenticated is displayed, and he/she is withdrawn the Internet access permission. This means he/she must be login again to have the permission.

System requirements

The followings are all you need to successfully deploy Oauth for OpenWrt:

  • OpenWrt firmware.
  • LuCi package.
  • Wifidog package.
  • Standard wget package.
  • Oauth for OpenWrt package.

a. Install Wifidog package:

  • Connect with your router via SSH.
  • Use this command to install Wifidog: opkg install wifidog.

Note: if you can not install wifidog, let's first use this command: “opkg update”, and then install it again.

b. Modify Wifidog's configuration file:

The configuration file of Wifidog is in /etc/wifidog.conf.

  • Use this command to access the file: vi /etc/wifidog.conf.
  • There are some parameters that you need to alter, according to your
    system: + ExternalInterface. + GatewayInterface. + GatewayAddress
    (your router) + AuthServer (your router) + GatewayPort.

c. Install Oauth for OpenWrt package:

We provide an ipk package to easily install via opkg.

You can also build your own from source (https://github.com/hongquan/Oauth for OpenWrt):

  • Copy the source folder to openwrt/package (source tree).
  • Rename Makefile_build_standalone to Makefile (replace the old
    Makefile).
  • Rename "dist" folder to "root" Choose the luci-app-Oauth for OpenWrt
    in"make menuconfig".
  • Run "make package/luci-app-Oauth for OpenWrt/compile V=99" to build.

After finishing the whole things above, let's do some more steps following to make Oauth for OpenWrt works:

  • In Terminal, connect to your router via SSH.
  • Run wifidog via this command: “/etc/init.d/wifidog start” (or
    “wifidog -d 7 -f” to see log information)
  • On your web browser, access your router via its IP address. After
    logging in, select tab “Network/Oauth for OpenWrt/Status”. Then,
    press “Apply” button.

Oauth for OpenWrt is now ready to work.

Configure Oauth for OpenWrt

We have created some nice stuffs for you to make Oauth for OpenWrt work as you like. First of all, you need to access the admin page of router by typing the your router address. There are some options that you can choose to bend the Oauth for OpenWrt with your needs.

本文章由 http://www.wifidog.pro/2015/04/07/wifidog%E5%AE%89%E8%A3%85%E6%8E%88%E6%9D%83.html 整理编辑,转载请注明出处

wifidog认证实现OpenWRT强制认证的WIFI热点

首先安装wifidog到OpenWRT的路由器:

  opkg update

  opkg install wifidog

wifidog依赖下面这些模块:

iptables-mod-extra

iptables-mod-ipopt

kmod-ipt-nat

iptables-mod-nat-extra

libpthread

由于trunk的固件更新会比较频繁,会导致直接opkg install wifidog安装不了,如果你凑巧又没有备份与固件对应的Packages的话,就需要到http://downloads.openwrt.org/snapshots/trunk升级固件,然后再安装wifidog。

如果你的路由器不是openwrt官方支持的版本的话,那就需要自己编译固件。make menuconfig后,在Network–>Captive Portals中选择wifidog.

安装完成后,

/etc/init.d/wifidog enable
/etc/init.d/wifidog start

这时会抛出一个错误,因为我们还没有设置AuthServer的信息。关于安装wifidog更多的信息可以参考:http://wiki.openwrt.org/doc/howto/wireless.hotspot.wifidog

下面安装Auth Server,按照官方的说法:
AuthPuppy is the next generation authentication server for Wifidog networks.
源文档 http://www.authpuppy.org/
不过貌似这wifidog和Authpuppy都已经N久没更新了。。。

AuthPutty是需要安装apache2, php5和MySQL。详细介绍在这里:http://www.authpuppy.org/doc/Getting_Started (Windows版点这里)。

安装成功后,访问AuthPuppy会要求设置一些数据库信息,全部设置完成后能看到首页:
wifidog2.jpg

当然了,我们还需要设置管理员的账号。

进入Manage plugins,Install apAuthLocalUserPlugin,记得要enable这个插件。

然后,点击Manage Nodes,把默认节点的status改成deployed。这个GW(Gateway) ID default后面配置wifidog.conf的时候需要使用。
wifidog4.png

到这里,AuthPuppy就基本配置完毕了。

下面回到路由器,编辑wifidog.conf,一般情况下,我们之后配置ExternalInterface,GatewayInterface和AuthServer这三项就可以,其他默认。下面是我的配置:

GatewayIDdefault           #注意这个ID必须跟AuthPuppy的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      #路由器外网的物理接口



# 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      #路由器内网的物理接口

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

}

注意这个Interface是物理接口。

root@OpenWrt:~# 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′

本文章由 http://www.wifidog.pro/2015/04/07/wifidog%E8%AE%A4%E8%AF%81wifi%E7%83%AD%E7%82%B9.html 整理编辑,转载请注明出处

wifidog认证无线认证管理

在网上了解到,许多实现无线或者有线Web验证的方案都用到 WiFi无线热点管理系统
目前比较主流的有:ros wiwiz 海蜘蛛这几个。ROS全称RouterOS软路由,最强大,但是比较复杂,海蜘蛛很容易,但效果一般般,WiWiZ实现一般,效果比较好,目前大部分研究的是wiwiz.为什么选择Wiwiz?并不是因为多人选我们就根从,而是因为它适合我们。

Wiwiz是一个开发式的系统,、装配置灵活,可以安装到路由器或者本地计算机、虚拟机都可以。通过Wiwiz Web控制面板创建并定制自己的热点。包括认证方式、是否付费及费率、认证页面的外观样式、颜色、图片以及服务条款都可以进行定制。为用户有偿提供网络服务。

Wiwiz系统,全称Wiwiz HotSpot Builder,一个WiFi无线热点管理系统,也可用于有线,
创建强制门户/认证页面。
Wiwiz HotSpot Builder的组成:
1、Wiwiz Web控制面板
2、客户端-Wiwiz HotSpot Builder Utility
部署了Wiwiz系统的计算机、路由器或者无线路由器充当WIFI网中的Internet网关。
可以实现Web认证。市面上创建商用Wifi热点的做法一般都是用强制网络门户系统(Captive Portal)/热点管理系统
来实现的。他们的原理都类似,需要一个防火墙/网关系统,一个用于认证管理和控制的后台系统。
常见的技术解决方案有NoCat、Wifidog、Chillispot等。有一些整套的解决方案,FON、Wiwiz、
ile sans fil、Sputnik、FreeSpot,这些要money的哦。wifidog 是免费开源的解决方案,只是性能不是很好,用于一般环境是足够的。

本文章由http://www.wifidog.pro/2015/04/07/wifidog%E8%AE%A4%E8%AF%81-5.html 整理编辑,转载请注明出处

海蜘蛛Tomato V3.3系统编译视频教程

很久没发布Tomato固件和帖子,今天给大家奉上一篇Tomato编译的教程,后期可能会陆陆续续地上传一些技术类视频,方便大家学习。由于工作和经济压力原因,没有时间做固件,但是非常感觉大家对我的支持。
未来的一段时间,我会转到幕后做一些Tomato的视频开发教程,让更多的人加入开发队伍中来。

视频是4K录制的,高清的土豆比较模糊,请大家选择超清播放,优酷视频还在审核中,请大家耐心等待。

视频中需要用到的代码和资料

请使用Ubuntu 64位系统

http://dl.hi-spider.com/mips/GPL_Hi-spider_tomatoV3.3.tar.gz

1.设置编译环境
在Ubuntu的系统执行如下命令

sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install libncurses5 libncurses5-dev m4 bison flex libstdc++6-4.4-dev g++-4.4 g++ libtool sqlite
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make gettext unzip zlib1g-dev
sudo apt-get install libc6 libncurses5-dev  automake


2.配置交叉编译工具

sudo cp -R opt/brcm 源码的位置/shibby_v3/tools/brcm /opt/brcm

vi ~/.bashrc
在最后一行处加入
if [ -d "/opt/brcm" ] ; then
    PATH=/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin:$PATH
fi
保存退出, 以便每次启动linux时能找到编译器.
source ~/.bashrc



find -type d -exec chmod +x {} \;

技术相关咨询和路由器定制联系:18013582125(QQ和手机是同一个)

本文章由 http://www.wifidog.pro/2015/04/03/tomato%E6%B5%B7%E8%9C%98%E8%9B%9B%E7%BC%96%E8%AF%91.html 整理编辑,转载请注明出处