Nodogsplash offers a simple way to provide restricted access to an internet connection. It is intended for use on wireless access points running OpenWRT (but may also work on other Linux-based devices). Its functionality is similar to Nocatsplash, but it is derived from the codebase of the Wifi Guard Dog project. Nodogsplash is released under the GNU General Public License.
The following describes what Nodogsplash does, how to get it and run it, and how to customize its behavior for your application.
Nodogsplash offers a solution to this problem: You want to provide controlled and reasonably secure public access to an internet connection; and while you want to require users to give some acknowledgment of the service you are providing, you don't need or want the complexity of user account names and passwords and maintaining a separate database-backed authentication server. When installed and running, Nodogsplash implements a simple 'authentication' protocol. First, it detects any user attempting to use your internet connection to request a web page. It captures the request, and instead serves back a 'splash' web page using its own builtin web server. The splash page contains a link which, when the user clicks on it, opens limited access for them to the internet via your connection, beginning by being redirected to their originally requested page. This access expires after a certain time interval. Nodogsplash also permits limiting the aggregate bandwidth provided to users, if you don't want to grant all of your available upload or download bandwidth. Specific features of Nodogsplash are configurable, by editing the configuration file and the splash page. The default installed configuration may be all you need, though.
Have a router working with OpenWRT. Nodogsplash has been compiled against a OpenWRT White Russian 0.9 buildroot; it may or may not work on other versions of OpenWRT or on other kinds of Linux-based router firmware. For notes on using Nodogsplash with OpenWRT Kamikaze, see_below.
Make sure your router is basically working before you try to install nodogsplash. In particular, make sure your DHCP daemon is serving addresses on the interface that nodogsplash will manage (typically br0 or eth1), and for the following use ssh or telnet access to your router over a different interface.
To install nodogsplash, obtain the nodogsplash*.ipk package you want to install from the project website, copy it to /tmp/ on your OpenWRT router, and, in as root on the router, run:
ipkg install /tmp/nodogsplash*.ipk
Or, to install the latest version, you can just run:
ipkg install http://kokoro.ucsd.edu/nodogsplash/latest.ipk
(Note: to prevent installation of an older package, you may have to remove references to remote package repositories in your ipkg.conf file.)
If the interface that you want nodogsplash to manage is not br0, edit /etc/ nodogsplash/nodogsplash.conf and set GatewayInterface.
To start nodogsplash, run the following, or just reboot the router:
/etc/init.d/S65nodogsplash start
To test the installation, connect a client machine to the interface on your router that is managed by nodogsplash (for example, connect to the router's wireless lan) and in a browser on that machine, attempt to visit any website. You should see the nodogsplash splash page instead. Click on the icon; the browser should redirect to the initially requested website.
To stop nodogsplash:
/etc/init.d/S65nodogsplash stop
To uninstall nodogsplash:
ipkg remove nodogsplash
A wireless router running OpenWRT has two or more interfaces; nodogsplash manages one of them. This will typically be br0, the bridge to both the wireless and wired LAN; or the wireless lan interface may be named something else if you have broken the br0 bridge to separate the wired and wireless LAN's.
3.1 Packet filtering
Nodogsplash considers four kinds of packets coming into the router over the managed interface. Each packet is one of these kinds:
Nodogsplash implements these actions by inserting rules in the router's iptables mangle PREROUTING chain to mark packets, and by inserting rules in the nat PREROUTING, filter INPUT and filter FORWARD chains which match on those marks. Because it inserts its rules at the beginning of existing chains, nodogsplash should be insensitive to most typical existing firewall configurations.
3.2 Traffic control
Nodogsplash also optionally implements basic traffic control on its managed interface. This feature lets you specify the maximum aggregate upload and download bandwidth that can be taken by clients connected on that interface. Nodogsplash implements this functionality by enabling two intermediate queue devices (IMQ's), one for upload and one for download, and attaching simple rate-limited HTB qdiscs to them. Rules are inserted in the router's iptables mangle PREROUTING and POSTROUTING tables to jump to these IMQ's. The result is simple but effective tail-drop rate limiting (no packet classification or fairness queueing is done).
The default shipped configuration is intended to be usable and reasonably secure as-is for basic internet sharing applications, but it is customizable.
To change basic nodogsplash settings, edit the configuration file:
/etc/nodogsplash/nodogsplash.conf
In the configuration file, a FirewallRule has the form:
FirewallRule permission [protocol [port portrange]] [to ip]
where
o permission is required and must be either allow or block. o protocol is optional. If present must be tcp, udp, icmp, or all. Defaults to all. o port portrange is optional. If present, protocol must be tcp or udp. portrange can be a single integer port number, or a colon-separated port range, e.g. 1024:1028. Defaults to all ports. o to ip is optional. If present, ip must be a decimal dotted-quad IP address with optional mask. Defaults to 0.0.0.0/0, i.e. all addresses.
To change the contents of the splash page, edit the splash page file:
/etc/nodogsplash/htdocs/splash.html
When the splash page is served, the following variables in the page are replaced by their values:
o $gatewayname The value of GatewayName as set in nodogsplash.conf. o $authtarget A URL which encodes a unique token and the URL of the user's original web request. If nodogsplash receives a request at this URL, it completes the authentication process for the client and replies to the request with a "307 Temporary Redirect" to the encoded originally requested URL. (Alternatively, you can use a GET-method HTML form to send this information to the nodogsplash server; see below.) As a simple example:
o $imagesdir The directory in nodogsplash's web hierarchy where images to be displayed in the splash page must be located. o $tok,$redir,$authaction, and $denyaction are also available and can be useful if you want to write the splash page to use a GET-method HTML form instead of using $authtarget as the value of an href attribute to communicate with the nodogsplash server. As a simple example:
To change the appearance of informational and error pages which may occasionally be served by nodogsplash, edit the infoskel file:
/etc/nodogsplash/htdocs/infoskel.html
In this file, variables $gatewayname,$version,$title, and $content will be replaced by their values. $title is a summary of the information or kind of error; $content is the content of the information or error message.
Nodogsplash can be configured to require a username and/or password to be entered on the splash page as part of the authentication process. Since the username and password are site-wide (not per user), and they are sent in the clear using HTTP GET, this is not a secure mechanism. To enable this, edit nodogsplash.conf to set parameters PasswordAuthentication, UsernameAuthentication, Password, Username, and PasswordAttempts as desired. Then the splash page must use a GET-method HTML form to send user-entered username and/or password as values of variables nodoguser and nodogpass respectively, along with others as required, to the server. For example:
A nodogsplash install includes ndsctl, a separate application which provides some control over a running nodogsplash process by communicating with it over a unix socket. Some command line options:
To print to stdout some information about your nodogsplash process:
/usr/bin/ndsctl status
To block a MAC address, when the MAC mechanism is block:
/usr/bin/ndsctl block MAC
To unblock a MAC address, when the MAC mechanism is block:
/usr/bin/ndsctl unblock MAC
To allow a MAC address, when the MAC mechanism is allow:
/usr/bin/ndsctl allow MAC
To unallow a MAC address, when the MAC mechanism is allow:
/usr/bin/ndsctl unallow MAC
To deauthenticate a currently authenticated user given their IP or MAC address:
/usr/bin/ndsctl deauth IP|MAC
To set the verbosity of logged messages to n:
/usr/bin/ndsctl loglevel n
For more options, run ndsctl -h. (Note that if you want the effect of ndsctl commands to to persist across nodogsplash restarts, you have to edit the configuration file.)
Nodogsplash operates by marking packets (and, if traffic control is enabled, passing packets through intermediate queueing devices). Most QOS packages will also mark packets and use IMQ's. Therefore one or both of Nodgsplash and a QOS package may malfunction if used together. Potential conflicts may be investigated by looking at your overall iptables setup. To check to see all the rules in, for example, the mangle table chains, run
iptables -t mangle -v -n -L
For extensive suggestions on debugging iptables, see for example Oskar Andreasson's_tutorial.
Eventually, new releases of Nodogsplash will be compiled against some stable version of OpenWRT Kamikaze. Meanwhile, Nodogsplash has been tested on some versions of Kamikaze and found to work. An explanation of steps that may be required to successfully install Nodogsplash on Kamikaze is available here: anarcat_post_on_forum.opernwrt.org Here is a shorter summary of what is required:
Kamikaze moves to a different way of organizing init scripts. Executable scripts reside in /etc/init.d, but appropriately named symlinks in /etc/rc.d determine the sequencing of scripts at boot. After installing Nodogsplash, do the following:
cd /etc/init.d mv S65nodogsplash nodogsplash cd /etc/rc.d ln -s /etc/init.d/nodogsplash S65nodogsplash
And then use /etc/init.d/nodogsplash to start and stop Nodogsplash from the command line.
Email contact: nodogsplash (at) kokoro.ucsd.edu