wifidog 配置中文说明

news/2024/11/24 4:03:15/

#网关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

 


http://www.ppmy.cn/news/675992.html

相关文章

android wifidog

一. 配置wifidog.conf 1. adb shell 1. ls /sys/class/net/ 2. 找到ap0,wlan0&#xff0c;或br0之类的接口 3. ifconfig ap0&#xff0c;注ap0&#xff0c;对应换成接口列表中的接口名&#xff1b;收到如&#xff1a;ap0: ip 192.168.43.1 mask 255.255.255.0 flags [up br…

wifidog源码分析

正文 程序启动过程 初始化运行参数--config_init() 读取配置文件--config_read(config->configfile) 检查关键参数是否存在--config_validate()--网关接口--认证服务器IP 初始化用户链表--client_list_init() 注册信号--由wdctl线程发送信号&#xff0c;重启等待--in…

wifidog 认证 php

<p style"margin-top: 0px; margin-bottom: 10px; padding-top: 0px; padding-bottom: 0px;">1.首先简单说说wifidog认证的过程客户端首次连接到wifi后&#xff0c;浏览器请求将会被重定向到&#xff1a;login/?gw_address%s&gw_port%d&gw_id%s&u…

公共场所wifi认证解决方案wifidog+authpuppy

服务器&#xff1a;linux mint 17.3 authpuppy 路由器&#xff1a;DB120 wifidog 手机一部 一、在OpenWrt的路由器上安装Wifidog应用程序 安装Wifidog程序有两种方式&#xff0c;一种是在刷了OpenWrt的路由器上直接安装Wifidog&#xff1b;或者是把Wifidog直接编译进OpenW…

在padavan运行wifidog

wifidog 作为一款wifi认证插件&#xff0c;在网上资料对于源码的分析可以说数不胜数。 而编译方面的是&#xff0c;偏向于OpenWtr固件。对于我这种使用padavan固件来说&#xff0c;想要使用wifidog的话&#xff0c;就只能自己摸索动手丰衣足食&#xff0c;使用交叉编译来完成编…

wifidog 配置文件

下面回到路由器&#xff0c;编辑wifidog.conf&#xff0c;一般情况下&#xff0c;我们之后配置ExternalInterface&#xff0c;GatewayInterface和AuthServer这三项就可以&#xff0c;其他默认。下面是我的配置&#xff1a; opk安装包&#xff1a;luci-app-wifidog-all.ipk 链…

Portal Server搭建(wifidog安装)

可以参考这篇文档&#xff1a; http://dev.wifidog.org/wiki/doc/install/ubuntu/auth-server#Configurelocaleinwifidog.conf 一、 安装前准备 打开终端&#xff08;用普通用户进入终端&#xff0c;不要用超级用户&#xff09;。 sudo apt-get update sudo apt-get instal…

Android下编译wifidog

1、从https://github.com/wifidog/wifidog-gateway上下载wifidog-gateway-master.zip&#xff0c;解压得到wifidog-gateway-master文件夹&#xff0c;丢到android源码目录下的extern文件夹。 2、修改src\conf.h&#xff0c;在extern pthread_mutex_t config_mutex;这一行之前添…