NoCatSplash

From DD-WRT Wiki

Revision as of 17:39, 30 September 2006 by Whiteboy (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

Enabling the use of NoCatSplash allows you to redirect a client to a specific web page when connecting via wireless or wired. It can redirect the client to a Splash URL hosted online (not on the router's filsystem). It can use the JFFS2 filesystem services on the router, so hosting the splash page can be done directly on the router. After being redirected to the splash page, the client can click on an 'I Agree', 'Continue' or similar button of your choosing on the splash page, and it brings the user to the page they were originally loading (or sends the client to the site of your choosing).

This could be use to advertise your neighbourhood wLAN, or display a splash screen in a cafe. While Authentication was originally envisioned for NoCat (NoCatAuth), support has been removed to make this as streamlined as possible. The DD-WRT version just displays a splash screen and nothing else. It will intercept the client's browser when the timeout period expires. So, once a day, or whatever interval you choose, the client will pull up the splash screen.

For me, NoCatSplash has been an easy point and click affair, using a Splash URL (not hosted locally on the router).

Simply enable NoCatSplash, enter your Homepage (this is the page people will be redirected to, after seeing the splash page), then add your Allowed Web Hosts (This should be/include the domain of the Splash URL. ex: if your Splash url is on http://yoursite.com/splash/index.htm; Your allowed host should be yoursite.com) (Don't have the http:// part on the allowed web hosts), Dont change the Document Root (leave it alone), Enter your Splash URL (ex: http://yoursite.com/splash/)

I left all of the other settings alone, and mine works fine!

A Notable Quirk: Your Splash page won't show anything linked outside of the html file if the Splash URL isn't hosted on the router or through a Samba mount. For example .css and images won't load, but style tags in the HEAD of your html page will.


Here a short overview how to enable nocatsplash using jffs in DD-WRT:

Note: You must have a DD-WRT Version installed which includes Nocatsplash, like the standard Version and you must have enough free memory for the jffs part.

1. In DD-WRT under Administration/Management enable under JFFS2 Support the first time both tags: JFFS2 and Clean JFFS2

2. reboot the system

3. create a folder named nocat per telnet (open your-router-ip, Login, mkdir /jffs/nocat)

4. check per telnet if the folder is created. (cd /jffs/nocat)

5. enable SSH in DD-WRT (under Administration/Services Secure Shell - enable)

6. Now you can enable SSH under remote Management (Administration/Management/Remote Access SSH Management enable)

7. Next you can start to create a Splash.html page. the easiest way is: copy the html text of an example into a new txt file and save this. Here is an example under splash.html: http://forum.bsr-clan.de/viewtopic.php?t=8319&highlight=nocat Then rename this to splash.html. Thats it. You can make changes in text, colours,etc.

8. Upload the splash.html file to /jffs/nocat. For Windows user: Download the Program Winscp and use this one. It is important that you use as Protocol SCP !!!

9. Finally configure DD-WRT as Described below.


Splash Page Code


Typical Oversight A typical problem with most installations is the administrator (you) forgetting that the splash page must contain a form with a button that submits certain data to the router, allowing it to "know" which clients have or have not visited the splash page.


Solution: The Form code for your "I Accept" button is similar to the following. This was taken from the original nocat splash page:

 <form name="login" method="post" action="http://192.168.1.1:5280/">
     <div align="center">
          <input type="hidden" name="accept_terms" value="yes" />       
          <input type="hidden" name="redirect" value="http://yoursitehere.com">
          <input type="hidden"    name="mode_login">
          <!--<input type="image"    name="mode_login"   src="images/login.gif" border="0">-->
          <input type="submit" value="enter">
          <!--<input type="submit" value="submit">-->
     </div>
 </form>

! Why are some of the buttons commented out. What actual data does the form need?!

Alternatively in the above example you can use "$redirect" for the redirect location (instead of http://yoursitehere.com) to allow the client to browse to their originally intended site vs. always being redirected to the site of your choosing.

Configuration

Image:V23-hotspot-nocatsplash.png

Image:V23-hotspot-nocatsplash-conf.png

Install
To make the configuration options appear, you have to enable NoCatSplash then Save the configuration. Now you can configure the options.
When finished configuring, use "Reboot Router".

Gateway Name
The name of the gateway. Whatever you want to call it. "Joe's Pizza Shop and free DSL Cafe" for example. Use the variable $GatewayName in your splash.html page to display this.

AllowedWebHosts
Space separated list of hostnames.
List any hosts (for example, the webserver with the splash page, or other websites) that you would like to allow clients to have web access to (TCP port 80 (HTTP) and 443 (HTTPS?)) before they "log in" (before they click on "I Accept" in your splash page), however actual authentication is not supported.
List any webservers, that you would like connecting clients to be able to access, before clicking on I Agree on the initial nocatsplash screen. Such as the webserver hosting your EULA or Welcome Page, if it isn't the router itself.

Document Root
Where all of the application templates (including SplashForm) are hiding. Can be different from Apache's DocumentRoot.
splash.html is the form displayed to users on capture.

Splash URL
Optional URL to fetch dynamic remote splash page from.
Leave empty if using a page stored on the router.

ExcludePorts
Space separated list of ports.
Specify TCP ports to denied access to when public class users login. All others will be allowed. If nothing is specified, access is granted to all ports to public class users.

You should *always* exclude port 25 (SMTP), unless you want to run a portal for wanton spam sending. Users should have their own way of sending mail. It sucks, but that's the way it is.

Login Timeout
How much time, in seconds, elapses before the client has to see the splash screen again, and click on 'I Agree'. How often a client is shown the EULA or other designated splash page.

For Open Mode portals, you probably want to set LoginTimeout to something large (like 86400, for one notification per day). Open Mode, is the only mode supported at this time.

Verbosity
Log verbosity (to syslogd)

  • 0 is (almost) no logging.
  • 10 is log everything.
  • 5 is probably a safe middle road.

Route only
Required only if you DO NOT want your gateway to act as a NAT.
Enable this only if you're running a strictly routed network, and don't need the gateway to enable NAT for you. You would not normally use this option. So if you don't understand it, leave it to No/Off.

A few things I found while looking for documentation on the net: In the nocat.conf file (you'll have to telnet or ssh into the router to set these)
comment: The only supported option at this time. I don't think it has to be set. GatewayMode Open
comment: The IP Range which will see the splash page.
LocalNetwork 192.168.1.0/24
comment: The LAN/wLAN IP of the router. I don't think it needs to be set
InsideIP 192.168.1.1
comment: The DNS server. Again, I don't think this needs to be set here.
DNSAddr 10.15.6.1

Advanced configuration

Daemon:
/usr/sbin/splashd

Configuration file:
/etc # cat nocat.conf

nvram entries:

NC_Verbosity=0
NC_SplashURL=http://www.mydomain.com/
NC_DocumentRoot=/jffs/nocat
NC_RouteOnly=0
NC_HomePage=http://www.mydomain.com/
NC_GatewayName=DDWRT
NC_ExcludePorts=25 21 23
NC_enable=1
NC_LoginTimeout=86400
NC_AllowedWebHosts=mydomain.com

Remarks

The TCP port to bind the gateway service to. 5280 is de-facto standard for NoCatSplash.

Just a couple things to keep in mind when using/testing this:

1. Since this is a web portal capture only, no other traffic is blocked.

2. DNS must happen in order for the redirection to occur - so if you are testing on a machine that is not connected up you will not see the capture page.

Documentation source

http://cvs.sourceforge.net/viewcvs.py/nocatsplash/nocatsplash/man/nocat.conf.5?rev=1.1.1.1&view=markup
NoCatSplash is copyright (c) 2004 - 2005 Schuyler Erle <schuyler@nocat.net> and Rob Flickenger <rob@nocat.net>, and is distributed under the GNU Public License v2 or better.
The original manual page is copyright 2005 Keegan Quinn.

http://cvs.sourceforge.net/viewcvs.py/nocatsplash/nocatsplash/nocat.conf.in?rev=1.1.1.1&view=markup

http://www.aixmarseille.com/NoCatSplash