Tuesday, 05 August 2014 11:38

打造openwrt+NoDogSpladh网站无线广告机

Written by
Rate this item
(0 votes)

此教程使用一个TP-Link TL-MR3020 3G/4G无线路由器来打造简单的无线广告机。目标是提供一个免费热点(hostpot)让公众无线上纲同时弹出hostpot提供者的广告(称之为Splash page 或者Landing page)。

TP-Link TL-MR3020的厂家固件(Firmware)功能有限,不能安装第三方软件包,因此,固件必须升级至OpenWRT,然后再安装NoDogSplash

虽然这里是使用TP-Link TL-MR3020为教题,一般支持OpenWRT的路由器也是适合的。 

升级OpenWRT固件
安装NoDogSplash前,必须先升级固件。注:TP-Link 厂家固件与OpenWRT固件都是英文版的,很多时候我也直接使用英文说明。

  • 寻找适合的OpenWRT固件,然后下载至电脑
  • 我下载了这个openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin
  • 通过网络传输线(Network patch cable),TL-MR3020与电脑连接
  • 启动浏览器,导航至http://192.168.0.254(这是TL-MR3020的默认IP)
  • 登录到路由器,用户名(user name)和密码(password)都是admin
  • 点击System Tools, 然后选择Firmware Upgrade
  • 点击Browse按钮,然后选择你之前下载的OpenWRT固件
  • 最后点击Upgrade按钮开始升级固件,如图所示
    升级OpenWRT固件

 

登录OpenWRT
  • 导航到http://192.168.1.1(IP已经从192.168.0.254改为192.168.1.1)
  • 此时不需输入密码,只需点击Login按钮
  • 首次登录者,必须点击Go to password configuration以便更换密码
    登录OpenWRT
  • 图下是我的TP-LINK TL-MR3020状态页
    OpenWRT版本

 

概述网络设置
为了安全起见,我设置了两个不同的IP地址范围(IP range),以防止外网(公众)电脑接入我的内网电脑。以下是我的网络设定:
  • AP (现有的无线互联网): 192.168.1.1
  • TP-Link TL-MR3020: 192.168.0.1
Network configuration
 
 
更改路由器的IP地址
  • 选择Network->Interfaces,然后单击Edit按钮,如图所示
    Network interfaces
  • 请输入你想要的IP地址。这里我把路由器的IP地址改成192.168.0.1
    Change network interface
  • 重新启动路由器
  • 更新电脑的IP以便和路由器的IP范围匹配
 
 
连接到互联网
TL-MR3020路由器只有一个RJ45网络接口,且已经被占用,唯一的方法就是通过无线(WIFI)连接到现存的AP(这个AP必须已经能上。这样也好,你可以扩展你的无线范围。
 
注意:
以下设定必须使用两组不同的IP地址范围,如果的APTL-MR3020路由器的IP地址范围相同,TL-MR3020将不能连接互联网。
  
  • 导航到  http://192.168.0.1  (请使用你自己的IP),并登录到OpenWRT
  • 选择Network->wifi,然后点击Scan按钮
    Wireless overview
  • 选择你想要连接的网络(现存的WIFI),点击Join Network按钮
    Join networ
  • 输入正确的密钥( key/passphrase),此密钥必须与你现存的WIFI相同
    Join Network Settings
  • 下一个画面不须更改任何设置,只需点击Save 按钮,然后继续
    Wireless network
  •  点击Wireless Security选项以查看你的网络安全设置(这步骤可以省略)
    Wireless Network Security
  • 最后Save & Apply按钮,不需重新启动路由器,设值即刻生效
  • 电脑通过网络线连接TL-MR3020,可以上网了
 
设置公共WiFi
的设定只能通过网线连接互联网,如果要提供公众无线上网(hotspot),TL-MR3020路由器必须设成AP模式
 
以上完全了的步骤是把TL-MR3020CLIENT模式步骤TL-MR3020增加一个AP模式。因此,TL-MR3020时拥有CLIENT模式AP模式
 
  1. 当TL-MR3020路由器工作为CLIENT模式时,它连接到现存的AP
  2. 当TL-MR3020路由器工作为AP模式,它让公众通过无线连接TL-MR3020
 
  • 选择Network->wifi ,然后点击Add按钮,如图所示
    Adding a new wireless network interface
  • 请输入ESSID,客人将会看到此网络名还有记得在Networ选项里选定lan,如图
    Setting the wireless network interface
  • 点击Wireless Security选项设定安全密钥,我选择No Encryption,因为它是对外开放
    Setting the Wireless Network Security
  •  重新启动路由器。路由器就绪后,任何电脑通过123无线网络与TL-LINK TL-MR3020连接的都能上网了
    Available wireless
 
 
安装与配置NoDogSplah
NoDogSplash提供一个免费的无线热点,可以设定上网限制。NodogSplash类似NoCatSplash,基于 WifiDog 而发展出来的
  • 确保TP-LINK TL-MR3020已经连接互联网 
  • 点击 System->Software ,然后点击 Available packages选项,此时会显示没有可用的软件包
  • 同一个画面里,点击Update lists按钮,它将会从OpenWRT的网络库下载安装包列表
    软件
  • 现在再点击 Available packages选项,一系列的安装包出现了
    Available pacages
  • OpenWRT真棒,竞然为我们准备了这许多的软件包。太多软件包会让人眼花瞭乱,必须过滤以方便安装
  • 现在要安装NoDogSplah,所以在Filter里输入nodogsplash,然后点击Find package 按钮
  • NoDogSplah出现,其旁边有一Install按钮,请点击之开始安装 NoDogSplah
  • 安装NoDogSplash
  •  看到以下画面表示安装  NoDogSplah 成功
    安装NoDogSplash成功

 

启动NoDogSplash
NoDogSplash必须启动后才能有效操作 
  • 选择System->Startup,在nodogsplash旁有一Disable按钮,请点击之
    启动系统
  • 在不需重新启动路由器情况下,点击Restart按钮就能让NoDogSplash服务立刻生效,如图所示。我发觉有时必须重启 NoDogSplash服务两次才能生效,不知道是不是OpenWRT的缺陷。如果你认为这样不保障,那就重新启动路由器吧!
    重新启动NoDogSplash
  • 导航到任何网站(如google.com或路由器的IP),NoDosgSplash页面(Landing page)将会出现
    NoDogSplash页面
  • 恭喜你,NoDogSplash运行无误。请点击那只“哈巴狗”开始浏览。
 
自定起始页面(Landing page)
起始页面是保存在 /etc/nodogsplash/htdocs目录里。编辑splash.hml文件来制定你的起始页面。我是使用WinSCP软件直接编辑与处理路由器上的文件。splash.hml可以使用标准的HTML和JavaScript编写
 
验证前或验证后,导航到路由器的IP及其2050端口(Port)就可以查看起始页面了,方便测试与调试
http://192.168.0.1:2050
 
 
NoDogSplash配置文件
不需更改NoDogSplash的配置文件,NoDogSplash也会工作很。为了更能配合你的无线网络系统,不修改该文件
NoDogSplash配置是保存在/etc/nodogsplash/nodogsplash.conf文件里。同样的也是使用WinSCP直接编辑
 
GatewayInterface(第14行)的默认值是br-lan。br-lan是把众多的网络接口当着一个网络接口,将 GatewayInterface设br-lan表示绑定到无线和有线接口。
GatewayInterface br-lan
 
验证后开启特定的端口 
例:在FirewallRuleSet authenticated-users区里面(第55行),加入以下两行指令允许Gmail使用电子邮件客户端软件(如微软的Outlook)收发电子邮件 
FirewallRule allow tcp port 995
FirewallRule allow tcp port 465
 
验证前允许访问某些IP地址
例:在 FirewallRuleSet preauthenticated-users 区里面89行)路由器的IP地址,无需进入NoDogSplash的起始页就能访问路由器的web图形界面了。
FirewallRule allow tcp port 80 to 192.168.0.1
 
开启443端口允许验证前访问Https网页
例:在 FirewallRuleSet preauthenticated-users 区里面89行)加入以下两行指令允许Facebook直接访问
FirewallRule allow tcp port 443
FirewallRule allow tcp port 80 to 73.252.64.0/18
 
验证后引导的URL(常是自己的网站)
例:用户验证后,第一时间将会将URL引导至我的个人网站。
RedirectURL http://www.ediy.com.my
 
强制客人在每段时刻重新验证新显示起始页面 
例:加入以下两行指强制客人至少每两小时(120分钟)重新验证
ClientIdleTimeout 120
ClientForceTimeout 120

 还有很多的设定,你自己去研究它的nodogsplash.conf文件

 

NoDogSplash信息 
SSH到路由器,能够看见许多有用的信息。
ndsctl status
这是输出样本

==================
NoDogSplash Status
====
Version: 0.9_beta9.9.8
Uptime: 0d 5h 42m 3s
Gateway Name: NoDogSplash
Managed interface: br-lan
Managed IP range: 0.0.0.0/0
Server listening: 192.168.0.1:2050
Splashpage: /etc/nodogsplash/htdocs/splash.html
Redirect URL: http://ediy.com.my
Traffic control: no
Total download: 0 kByte; avg: 0 kbit/s
Total upload: 0 kByte; avg: 0 kbit/s
====
Client authentications since start: 6
Current clients: 2

0 Client 
IP: 192.168.0.120 MAC: 00: 11: 22: 33: 44: 55 
Added: Fri Jul 28 07:26:51 2014 
Active: Fri Jul 28 07:56:41 2014 
Active Duration: 0h 29m 50s 0D 
Added Duration: 0h 29m 50s 0D 
Token: 9660d3fc 
State: Authenticated 
Download: 2170 kByte; AVG: 9.69893 kbit / s 
upload: 401 kByte; AVG: 1.79455 kbit / s 

 

1 Client 
IP: 192.168.0.120 MAC: 11: 22: 33: 44: 55: 66 
Added: Fri Jul 19 12:23:34 2014 
Active: Fri Jul 19 12:29:15 2014 
Active Duration: 0D 0h 5m 41s 
Added Duration: 0D 0h 5m 41s 
Token: ac37311a 
State: Authenticated 
Download: 1575 kByte; AVG: 36.9634 kbit / s 
upload: 169 kByte; AVG: 3.96788 kbit / s

 

====
Blocked MAC addresses: none
Allowed MAC addresses: N/A
Trusted MAC addresses: none
========

 

 

Save

Read 27094 times Last modified on Sunday, 12 June 2016 11:44

51 comments

  • Comment Link SipAwainnaceara Tuesday, 14 April 2020 09:40 posted by SipAwainnaceara

    https://cbdoilwalmart.com/ buy cbd cbd oil online cbd drops buy hemp

  • Comment Link rboozBaw Tuesday, 14 April 2020 02:50 posted by rboozBaw

    how to make money online fast ways to make money make money make money blogging how to make money selling drugs

    how much money can you make on youtube how to make money as a kid work from home how to make money as a kid make money now

    http://yk-eksa.ru/ - make money

  • Comment Link jhjwfBaw Monday, 13 April 2020 09:07 posted by jhjwfBaw

    apps to make money how to make fast money online work from home make money online fast how do youtubers make money

    apps to make money how to make money at home make money how to make money with a website make extra money

    https://make-money-blogs.com/# - work from home

  • Comment Link aigahBaw Sunday, 12 April 2020 13:39 posted by aigahBaw

    make money from home ways to make money online make money make money on facebook how to make money on the internet

    photos imgclick easily make money sharing will friends social free file upload hobbies that make money make money legitimate ways make extra money how do you make money on youtube

    https://make-money-blogs.com/# - make money

  • Comment Link dhzznBaw Friday, 10 April 2020 17:36 posted by dhzznBaw

    quick business loans for startups quick cash loans scam quick loan fast quick loans quick loans near me

    quick loans cash loans quick quick loan low interet rate quick loans quick business loans for startup

    https://paydailoanz.com/# - quick loans

  • Comment Link eiaxnBaw Friday, 10 April 2020 03:09 posted by eiaxnBaw

    quick loans for bad credit quick cash loans nm quick loans quick loans no credit check quick online business loans

    quick funding loans freedom card safe quick loans quick loan low interet rate quick loans bad credit loans quick approval

    https://paydailoanz.com/# - quick loans

  • Comment Link qwnqsBaw Thursday, 09 April 2020 08:39 posted by qwnqsBaw

    quick cash online loans quick cash loans broken arrow quick loans quick and loans quick credit loans

    quick loans in pell city alabama quick approval personal loans quick loans quick 200 dollar loans quick 200 dollar loans

  • Comment Link DaniloSkync Thursday, 09 April 2020 02:24 posted by DaniloSkync

    Live Casino Online|Terpercaya|Terbesar|Terbaik|Resmi|Uang Asli|Indonesia| } – 918indo.com http://www.918indo.com/tag/live-casino-onlineterpercayaterbesarterbaikresmiuang-asliindonesia/ - Live Casino Online – 918indo.com|Click here|More info|Show more}>>>

  • Comment Link DaniloSkync Tuesday, 07 April 2020 17:57 posted by DaniloSkync

    DEPOSIT 918KISS uang asli – 918indo.com http://www.918indo.com/tag/deposit-918kiss-uang-asli/ - Show more>>>

  • Comment Link bbjyvBaw Monday, 06 April 2020 04:55 posted by bbjyvBaw

    viagra fuck can you buy viagra online viagra vs cialis joel and lauren viagra prank substitutes for viagra

    how long for viagra to take effect? can you buy viagra with a perscripen natural viagra mom viagra accident can a 64 year man recover from ed without viagra

    https://viagrnetwork.com/# - viagra online

  • Comment Link DaniloSkync Sunday, 05 April 2020 08:50 posted by DaniloSkync

    slot jackpot winners – 918indo.com http://www.918indo.com/tag/slot-jackpot-winners/ - Click here!..

Leave a comment

Back to Top