wifidog 配置中文说明

#网关ID
GatewayID default
#外部网卡
ExternalInterface eth0
#无线网卡
GatewayInterface eth0
#无线IP
GatewayAddress 192.168.1.1
#路由状态HTML
HtmlMessageFile wifidog-msg.html 
#验证服务器
#AuthServer {
#    Hostname                 (Mandatory; Default: NONE)
#    SSLAvailable             (Optional; Default: no; Possible values: yes, no)
#    SSLPort                  (Optional; Default: 443)
#    HTTPPort                 (Optional; Default: 80)
#    Path                     (Optional; Default: /wifidog/ Note:  The path must be both prefixed and suffixed by /.  Use a single / for server root.)
#   LoginScriptPathFragment  (Optional; Default: login/? Note:  未用户登录重定向地址.)
#   PortalScriptPathFragment (Optional; Default: portal/? Note:  登录成功后重定向地址.)
#   MsgScriptPathFragment    (Optional; Default: gw_message.php? Note:  退出登录后重定向地址.)
#   PingScriptPathFragment    (Optional; Default: ping/? Note:  路由状态心跳地址.)
#   AuthScriptPathFragment    (Optional; Default: auth/? Note:  路由请求服务器验证地址 and 验证心跳地址(stage=counters).)
#}

AuthServer {
    Hostname auth.com
    #SSLAvailable yes
    Path /
}

# 是否后台进程
# Daemon 1
#默认网关端口
# Default: 2060
GatewayPort 80

# HTTP进程名
# HTTPDName WiFiDog

# HTTP最大连接数
# Default: 10
# HTTPDMaxConn 10

# WEB页面加密码后显示名
# Default: WiFiDog
# HTTPDRealm WiFiDog

# WEB加验证
# HTTPDUserName admin
# HTTPDPassword secret

# 心跳间隔时间
# Default: 60
CheckInterval 60

# 心跳间隔次数 验证超时数等于 CheckInterval*ClientTimeout 
ClientTimeout 2

# 信任的MAC地址,加入信任列表将不用登录可访问
#TrustedMACList 00:00:DE:AD:BE:AF,00:00:C0:1D:F0:0D

#其他防火墙设置

#全局
FirewallRuleSet global {
    ## To block SMTP out, as it's a tech support nightmare, and a legal liability
    #FirewallRule block tcp port 25
    
    ## Use the following if you don't want clients to be able to access machines on 
    ## the private LAN that gives internet access to wifidog.  Note that this is not
    ## client isolation;  The laptops will still be able to talk to one another, as
    ## well as to any machine bridged to the wifi of the router.
    # FirewallRule block to 192.168.0.0/16
    # FirewallRule block to 172.16.0.0/12
    # FirewallRule block to 10.0.0.0/8
    
    ## This is an example ruleset for the Teliphone service.
    #FirewallRule allow udp to 69.90.89.192/27
    #FirewallRule allow udp to 69.90.85.0/27
    #FirewallRule allow tcp port 80 to 69.90.89.205
}

# 新验证用户
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 to baidu.com
    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
}

 

域名过滤支持:

fw_iptables.c

iptables_compile 修改:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if  (rule->mask != NULL) {
         char  *mask=rule->mask;
         int  mask_len= strlen (mask);
         int  is_domain=0,
             i=0;
         for (;i<mask_len;i++){
             if ((mask[i]>=46&&mask[i]<=57)||mask[i]==32){
                 continue ;
             } else {
                 is_domain=1;
                 break ;
             }
         }
         char  * ip =NULL;
         if (is_domain){
             struct  in_addr * h_addr =wd_gethostbyname(mask);
             if (h_addr){
                 ip= safe_strdup(inet_ntoa(*h_addr));
                 free (h_addr);
             }
             if (ip){
                 mask=ip;
             } else {
                 debug(LOG_ERR,  "doamin %s not find ip try again!" ,mask);
                 mask= "0.0.0.0" ;
             }
         }
         snprintf((command +  strlen (command)), ( sizeof (command) -
                     strlen (command)),  "-d %s " , mask);
         if (ip){
             free (ip);
         }
     }

 conf.c 

_parse_firewall_rule 修改:

1
2
3
4
5
6
7
for  (i = 0; *(mask + i) !=  '\0' ; i++)
             if  (! isdigit ((unsigned  char )*(mask + i))
                     &&! isalpha ((unsigned  char )*(mask + i))
                     && (*(mask + i) !=  '-' )
                     && (*(mask + i) !=  '.' )
                     && (*(mask + i) !=  '/' ))
                 all_nums = 0;  /*< No longer only digits */



集合盒子 内核态 实现 wifidog

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1、因手头有一个7620N芯片的大功率无线路由器(万兴达WR5508商用路由),由于要使用无线广告营销功能,但在网上搜寻了很久,都没找到合适的固件。 2、可能有人会说支持7620方案的广告营销固件多的是,但这款路由器是大功率的,500mW,刷了海蜘蛛、RippleOS以及其他有wifidog功能的固件,无线超过3-5米就没有信号了。只有刷了openwrt和PandoraBox固件,无线信号超级强大,达到26db。 3、因此,只能使用openwrt和PandoraBox固件,查询了多种方法,都是需要对固件进行编译的,由于小弟不懂编程,只有通过网友们的安装配置经验进行参考,在刷好的固件基础上安装wifidog和Luci界面的配置,如果哪位高手能将Luci-wifidog源码打包成ipk安装包,小弟万分感谢!此方法仅供想玩wifidog的朋友参考,编程高手勿拍砖就行了! 方法: 1、安装wifidog(前提是路由器必须接入互联网) [root@PandoraBox:/root]#opkg update [root@PandoraBox:/root]#opkg install wifidog [root@PandoraBox:/root]#/etc/init.d/wifidog enable [root@PandoraBox:/root]#/etc/init.d/wifidog start 备注:安装wifidog可能需要依赖包 libc iptables-mod-extra iptables-mod-ipopt iptables-mod-nat-extra libpthread 2、安装配置luci-wifidog(luci-wifidog源码是在网上找的,别人已经设置好了的,如果不喜欢,自行到官网下) (1)使用winscp把源码controller文件夹下的内容复制到/usr/lib/lua/luci里目录的controller下,model放到model下 (2)源码root文件夹下的内容复制到root/etc下各自相应的目录下 (3)源码ipkg文件夹下的内容复制到/usr/lib/opkg目录下 (4)源码makefile文件复制到/etc下并给xxx权限 (5)最后重启路由器。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值