home  wiki

Spelling: MWRPHotspot



* Ready for Beta users. [1]

* If you have a WRT and want to run it as a hotspot [2]
* and know a little about iptables ( or want to ) [3]
* then install the package and give it a try [4]
* leave any questions or feedback at the bottom of this page [5]

* Hotspot [6]
* Disclaimer [7]
* How it works [8]
* What is involved [9]
* Firewall [10]
* Platforms [11]

* OpenWrt package [12]
* Other Linux [13]
* Non-Linux [14]

* Customization and configuration [15]

* 1. Select Zones [16]
* 2. Configure Zone [17]
* 3. Manage ACL [18]
* 4. Configure ports [19]
* Moving capture httpd to non standard port [20]

* Problems [21]

* Internet connection [22]
* limited set of ports able to be opened for members and public
users [23]

* Beta testing comments & questions [24]

READY FOR BETA USERS.

IF YOU HAVE A WRT AND WANT TO RUN IT AS A HOTSPOT

AND KNOW A LITTLE ABOUT IPTABLES ( OR WANT TO )

THEN INSTALL THE PACKAGE AND GIVE IT A TRY

LEAVE ANY QUESTIONS OR FEEDBACK AT THE BOTTOM OF THIS PAGE

HOTSPOT

This is a package for Melbourne Wireless Nodes to implement a simple
LIGHT-WEIGHT captive portal. The majority of existing captive portal
applications are more comercially oriented and often require the setup
of a radius server.

This implementation is based on a few simple concepts:

* Use of MW website sign-on to authenticate users, so you doo need to
have a route to the Intenet.
* Interception of incoming http requests from connected but
not-signed-on users
* Modification of web server to return a 301 (redirect) instead of a
404 (Not Found) messages to "capture" a user trying to access a web
page that they cannot get to because of the Node firewall.

There is a default SPLASH page that lists terms and conditions of
network access. A user may connect to the network if they agree with
the T&Cs. There is also a check box to indicate if you are a Melbourne
Wireless member.

The Node owner can decide what level of access (full, restricted or
none) they want to grant the public and a MW member. Restricted levels
of access can be set up that allow only specified services ( e.g.
POP3, SSH, certain web sites).

DISCLAIMER

This package is not for everyone. If you know your way around
iptables then you probably don't need it. It is intended for people
that are not comfortable tweaking these things but want to open their
node up in a controlled manner.

Also, if you try this and things go wrong I'll try to get you going
again, but you may have to wait until I have time to do it. I offer no
warrenty or suitability of purpose etc. etc.

If you are unsure then don't install it just now, wait until the beta
testing has worked out the remaining bugs.

HOW IT WORKS

On boot up an init script ( S45firewall ) sets up your firewall. In
the PREROUTING table it redirects all http traffic from the wireless
interface to the access port of the patched httpd. This is the
capture. All other traffic from the wireless interface is REJECTED.

The user is presented with a splash page (like this ). If they do not
accept the T&Cs then they get a page requesting they dis-associate
form the network. They will not be able to do anything as the firewall
will DROP their packets.

If the user is a MW member and check the option, they will get a
redirect to the MW web site and get a sign-on page. If they correctly
sign on then the firewall will be modified to allow them through.

A member of the public does not have to sign-on, once they accept the
T&Cs they get re-directed to a welcome page ( like this ) that lets
then know what access they have.

Once the user has been added to either the PUBLIC_USERS or
MEMBER_USERS table then they are able to access the network and
services as defined for the group they are in.

WHAT IS INVOLVED

* Simple init script to set up the firewall
* Some commands for adding and removing users from iptables
* Some web pages and some cgi-scripts
* A modified (tiny) httpd to handle the captured users
* You will need the ip-tables mac module in your Linux distribution.
There are two parts of this, 1) the kernel module ipt_mac.o and 2) the
iptables loadable module

FIREWALL

If you are running the hotspot package then it becomes your firewall.
It is configured using iptables and is very tight. You choose what
ports and services you want to allow each class of user. See
MWRPfirewall for a more detailed description and hints on how to set
it up if you have a different arrangement of ports and interfaces.

PLATFORMS

OPENWRT PACKAGE

The Beta version is available to download. You can downlaod it and
install from a local machine or run

ipkg install
http://melbournewireless.org.au/files/wrt54/Packages/mwhotspot_0.8_mipsel.ipk
Once installed it will add Melb Wireless to your packages and you can
install updates easily by entering

ipkg update ipkg mwhotspot

OTHER LINUX

There is a general tarball that you can download and install. There
are only a few moving parts so it's not that dificult. Included is a
tiny httpd for x86 that will be installed with the tarball. This can
be run on a non-standard port allowing the "captured" http requests to
be processed correctly while signed-on users cold access web content
from a regular (un-modified) web server.

NON-LINUX

Sorry, this is based around manipulating the netfilter parameters
using iptables.

CUSTOMIZATION AND CONFIGURATION

Once the package is installed there is a simple shell script menu (
/bin/hotpot/menuconfig ). Running this script will generate your
hotspot configuration data.

* /etc/hotspot/hotspot.cfg, configuration env vars used by
S45firewall
* /etc/hotspot/hotspot.acl, pre-defined mac addresses and their
acess groups
* /etc/hotspot/hotspot.ports, open ports for member and public
groups

You can run the script as may times as you want, at any time. The
changes will not come into effect until the S45firewall is reloaded (
either by running it from the command line or rebooting ).

Melbourne Wireless hotspot
Configuration Menu ------------------ 1. Select Zones 2. Configure
Zone 3. Manage ACL 4. Configure ports 5. Exit, Save changes 6. Quit
Don't save -------------------
make selection (1-6)

1. SELECT ZONES

You are presented with the names of the four configurable zones here:

* LAN, the PUBLIC zone your hotspot will expose
* WAN, the zone of the Internet connection if connected directly
* PRI, your private LAN zone if the node is connected to one
* DMZ, your DMZ segment if you have one ( this is not coded out yet)

2. CONFIGURE ZONE

For each of the zones you selected in part 1. of the menu there are a
number of configuration parameters that need to be captured. A simple
set of questions ask for the name of the interface (i.e. br0, vlan1,
eth1) IP addresses and other configuration information NEEDED FOR THE
HOTSPOT AND FIREWALL ONLY. This will not do any configuration of the
NVRAM variables, interfaces or routing and bridging.

3. MANAGE ACL

A privileged user is one that does not have to go through the capture
process, i.e. your own laptop machine. Using this mechanism I have
turned of the AP I was using internally as my laptop can now just pass
through my MW Node instead.

Privileged users information is maintained in the file
/etc/hotspot/hotspot.acl. A line in this file looks like this:

00:03:23:d3:b1:34 myhotspot1 owner allow 00:30:45:ea:2d:f7
badguy public deny

4. CONFIGURE PORTS

In this menu section you are able to select the access to grant MW
members and the general public ( full, restricted, none). If
RESTRICTED access is selected then you are prompted for ports that
should be open for this group of users.

A future enhancement will make this a bit easier to use and allow you
to capture IP addresses or address ranges.

MOVING CAPTURE HTTPD TO NON STANDARD PORT

The httpd that is provided in the package is a very lightweight one.
For a full linux distribution you probably want to keep using your
existing web server and should just run the tiny httpd on a different
port.

Using menuconfig select CONFIGURE ZONES and LAN ZONE. One of the
options there will be for setting the port used by the capture httpd.
Changing this option to another number will set an environment
variable \'HS_LAN_CAPTURE_PORT that is used by both the S45firewall
and the S50httpd scripts.

In the S45firewall script

$IPT -t nat -A PREROUTING -p tcp --destport 80 -j DNAT --to
${NETIP}:${HS_LAN_CAPTURE_PORT:-80}

In the S50httpd script

/usr/sbin/httpd -p $. Also, when you display this page, show the
existing ACL entries - or maybe even on a "status" page that displays
all the current settings.
* Can we have a menu option to change the IP address/web address
that the user is redirected to? At the moment it wants to go to
10.10.1.65 and it's hard-coded into index.html.

Since OpenWRT [27] now has a web interface, It'd be nice if these
menuconfig scripts were web-based also. I believe webif has been
designed for "plug-in" interfaces for other packages.

In general, this package is a corker - it is already much better than
NoCatSplash [28] - which I've used and had all sorts of trouble with.

It'd be nice if the config scripts could do a bit of autoconfiguring
- i.e. doing ifconfig and iwconfig and working out what interface is
what - and presenting these interfaces to the user and ask him/her
which is public or private. Under Openwrt, having the public wireless
interface separate from the LAN would require breaking the bridge -
perhaps we could distribute a package that does this automatically by
setting the appropriate NVRAM vars - with the appropriate warnings and
"are you sure" dialogs.

A package like this raises a couple of political points too - do we
want to say that Internet access is being provided by Melbourne
Wireless? I notice that the terms and conditions are a bit of a cut
and paste job - but that's OK I understand it's beta software. We
should sit down and discuss what we want the splash page to say.

My personal view is that perhaps in the future the package should be
"themeable" - and that the Melb Wireless look should be one of many
themes. the default theme should be a generic splash page with generic
T&Cs.

But once again, great job!

Links:
------
[1] http://melbournewireless.org.au/#ready_for_beta_users__
[2]
http://melbournewireless.org.au/#if_you_have_a_wrt_and_want_to_run_it_as_a_hotspot
[3]
http://melbournewireless.org.au/#and_know_a_little_about_iptables_or_want_to_
[4]
http://melbournewireless.org.au/#then_install_the_package_and_give_it_a_try
[5]
http://melbournewireless.org.au/#leave_any_questions_or_feedback_at_the_bottom_of__this_page
[6] http://melbournewireless.org.au/#hotspot
[7] http://melbournewireless.org.au/#disclaimer
[8] http://melbournewireless.org.au/#how_it_works
[9] http://melbournewireless.org.au/#what_is_involved
[10] http://melbournewireless.org.au/#firewall
[11] http://melbournewireless.org.au/#platforms
[12] http://melbournewireless.org.au/#openwrt_package
[13] http://melbournewireless.org.au/#other_linux
[14] http://melbournewireless.org.au/#non_linux
[15] http://melbournewireless.org.au/#customization_and_configuration
[16] http://melbournewireless.org.au/#1__select_zones
[17] http://melbournewireless.org.au/#2__configure_zone
[18] http://melbournewireless.org.au/#3__manage_acl
[19] http://melbournewireless.org.au/#4__configure_ports
[20]
http://melbournewireless.org.au/#moving_capture_httpd_to_non_standard_port
[21] http://melbournewireless.org.au/#problems
[22] http://melbournewireless.org.au/#internet_connection
[23]
http://melbournewireless.org.au/#limited_set_of_ports_able_to_be_opened_for_members_and_public_users
[24]
http://melbournewireless.org.au/#beta_testing_comments___questions
[25] http://melbournewireless.org.au/?WhiteRussian
[26] http://melbournewireless.org.au/?WhiteRussian
[27] http://melbournewireless.org.au/?OpenWRT
[28] http://melbournewireless.org.au/?NoCatSplash

[EditText] [Spelling] [Current] [Raw] [Code] [Diff] [Subscribe] [VersionHistory] [Revert] [Delete] [RecentChanges]

> home> about> events> files> members> maps> wiki board   > home   > categories   > search   > changes   > formatting   > extras> site map

Username
Password

 Remember me.
>

> forgotten password?
> register?
currently 0 users online
Node Statistics
building132
gathering193
interested515
operational233
testing214