Easy Hotspot Documentation
Easy Hotspot Documentation
1. Introduction
2. Installation
3. Configuration
4. Using EasyHotspot
1. Admin
1. Chillispot Configuration
2. Postpaid Setting
3. Billing Plan
4. Cashiers Management
5. Admin Management
2. Cashier
1. Postpaid Account Management
2. Voucher Management
3. Invoice Management
4. Statistics
5. Online users (force disconnect)
6. Change password
3. Clients
1. How to connect the Hotspot
2. How to browse to web
3. How to logout
5. Troubleshooting
1. Change network interface name
2. Change MySQL default password
3. Client is not redirected to login page
Introduction
EasyHotspot is an alternative solution for hotspot billing system. Its contains other particular
open source software that is bundled into one a single package. We don't try to make a
replacement to similar existing open source projects. Our aim is to deliver a system that simple,
easy to install, use and modify. EasyHotspot comes with ready to use configuration. You need
less configuration to build a running hotspot. It will save you time and energy.
EasyHotspot is developed on the top of Ubuntu distribution. The hotspot manager frontend used to
manage your hotspot is built from Codeigniter framework. Codeigniter is an blazing fast PHP framework
which easy to understand and its very handy to make a web based application. We hope everyone can
easily understand and make an improvement to the code. FreeRADIUS will help us to perform AAA
process. The Captive Portal that is used for authenticating users is Chillispot, and the database / MySQL,
it used for storing the users and logs information.
Who's gonna need it ? Anyone who wants to build a hotspot or someone who willing to learn how
hotspot works. . For example : Cafe, Hotel, School, Public place, and anywhere that requires wireless
internet connection.
How to get involved ? Ok, this is our favorite part ... its easy to get involved and help this project. You
can report the bugs, make an improvement/variation, request new features, critics, fill up our wish list,
spread the word. Everything positive are welcome :)
Instalation
Minimum Hardware requirements:
Pentium 3 or equal
512 MB RAM
5 GB Free Space HDD
2 network interface (LAN CARD)
Wireless Access Point (you don't need wireless router feature but a Wireless AP)
Switch/Hub (optional, only for wired user)
Installation
EasyHotspot comes with live Ubuntu distro iso, burn the .iso on to blank cd-rom and then boot
your PC from cd-rom.
Once Ubuntu has startup you can install from the shortcut on the desktop. And follow the
instructions to install Ubuntu and EasyHotspot on the screen.
For help installing ubuntu you can find it here
https://help.ubuntu.com/community/GraphicalInstall
When Ubuntu has rebooted, locate http://localhost/easyhotspot from your browser and
EasyHotspot is ready to roll.
Configuration
After the installation process has successfully completed, there are several steps left to ensure
that EasyHotspot is running smoothly.
Internet interface
Set your eth0 as your internet connection source. It can be dynamic or static. If you have a
dynamic connection, just simply plug in the ethernet cable to eth0 interface, or if you have a
static connection you can configure it by clicking the network icon on system tray and hit
manual configuration.
Distribution interface
eth1 will act as the distribution interface. You don't have to configure this interface at all. Just
connect to AP or Switch hub and then let your client connect . Make sure that you have
disabled DHCP, Encryption, and Router feature in your AP or router (if exist).
3. Setting Language
For now EasyHotspot only supports English, Indonesia & Spanish language. The language setting
is set in, system/application/config/config.php as the $config['language'] setting. If you want
create a new translation then copy the existing language directory preferably English and
translate easyhotspot_lang.php to your language put it in a new directory e.g:
system/application/language/latin/easyhotspot_lang.php
4. Setting Homepage
By default, EasyHotspot is only accessible from the server itself (localhost), if you want to
remote your billing system you could tell EasyHotspot to change the homepage from locahost to
your accessible IP Address. Edit
/opt/local/web/htdocs/easyhotspot/system/application/config/config.php, find
$config['base_url'] line.
Example:
$config['base_url'] = "http://192.168.182.1/";
top
Using Easyhotspot
EasyHotspot comes with a preconfigured hotspot system and a web interface to manage
everything that's related to user administration and billing activity. Locate EasyHotspot
homepage from your browser (firefox) at http://localhost/easyhotspot
Admin : this user handles billing plan, price and system configuration.
Cashier : this user handles user account, voucher generation, invoice, view stats.
top
Admin
username: admin
password: admin123
The home page for admin is where you can see the hotspot info and system info to see that
everything's running smoothly.
1. Chillispot Configuration
In this page you can edit the basic configuration for your hotspot:
o Radius Server 1 (Address of primary RADIUS server, default 127.0.0.1)
o Radius Server 2 (Address of secondary RADIUS server, default 127.0.0.1)
o Radius Secret (Secret phrase between RADIUS server and Chillispot)
o DHCP Interface (Which interface you want to use as Hotspot Interface)
o UAM Server (Address of captive portal stored)
o UAM Secret (Secret phrase between login page and q Chillispot)
o Client's Homepage (Where do you want to redirect your client for the first time)
o Allowed URL (URL that clients could browse without login, DO NOT PUT SPACES. exp :
www.google.com,www.twitter.com")
o DHCP Range (DHCP IP's for clients - must be in XXX.XXX.XXX.XXX/XX format)
2. Postpaid setting
On Postpaid setting page you set the desired rate for postpaid account, how much to
charge for either each megabyte (1 MB) or each minute. Idle time out automatically logs
out a user if they are idle for the amount of time (in minutes) entered. Download and
upload rate determines the maximum bandwidth allowed for a postpaid account. If you
edit the settings on this page, all of the existing postpaid account that has been created
will automatically change according to the settings on this page.
3. Billing plan
The billing plan page is used to make billing plan to use as a template for creating
vouchers on the cashier page. To create a new billing plan enter the fields below the list
of the existing billing plan. You can also delete an existing billing plan by clicking on the
X on the row of the billing plan that you want to delete, and you can also edit the billing
plan by clicking on the pencil icon.
4. Cashier Management
Basically the Admin and Cashier management are the same, the difference is on the role of the
user.
On the Manage cashier / admin page you will be presented with the list of cashiers / admins.
5. Admin Management
Basically the Admin and Cashier management are the same, the difference is on the role of the
user.
On the Manage cashier / admin page you will be presented with the list of cashiers / admins.
top
Cashier
You can login as cashier after you have created a cashier account from the admin page.
3. Invoice Management
You can view detail of all the invoices and print the desired invoice for postpaid account from
this page.
4. Statistics
A simple statistical view of all of the vouchers, billing plans and accounts created.
5. Online users (force disconnect)
Force disconnect users can be used to disconnect an online client from the cashier page.
6. Change password
Change the cashiers password.
top
Clients
3. How to Logout
Simply type 'splash' on the address bar and you will logged out.
top
Troubleshooting
Change network interface name
We highly recommend you to make sure that you have 2 interface named eth0 and eth1. eth0 will
be act as an internet line and eth1 as a distribution interface. If your interfaces name are not eth0
and eth1 you should change it. This is how to do it :
edit the /etc/udev/rules.d/70-persistent-net.rules file
example :
from
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:16:d3:5e:8f:f3", NAME="eth3" # PCI device
0x14e4:0x4311 (bcm43xx) SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:19:7e:a5:45:84",
NAME="eth4"
to
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:16:d3:5e:8f:f3", NAME="eth0" # PCI device
0x14e4:0x4311 (bcm43xx) SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:19:7e:a5:45:84",
NAME="eth1"
It would be better to change the default root and easyhotspot user password. You can search the
details of how doing that at mysql documentation. After that don't forget to edit the
/opt/local/web/easyhotspot/htdocs/application/config/database.php
Client is not redirected to login page
First of all, I'll say this - if its at all possible to install the Ubuntu distro of EasyHotSpot
(available from the EasyHotSpot download page), do so!
I couldn't because I couldn't get Ubuntu 10.04 installed on my antique laptop which I was going
to use as the internet gateway. Only Ubuntu 10.10 worked. I therefore had to install Chillispot,
FreeRadius etc and configure them separately, which was a real pain.
Secondly, if you read the documentation for EasyHotSpot, nowhere is there any mention of
support for per-user bandwidth quotas.
Well, my realization was that, since all the accounting is handled in MySQL, all I needed to do
to simulate daily quotas was to setup a cron job which runs daily at midnight which clears out the
relevant tables which contains the bandwidth usage data. I'll be providing that script later on...
So, I'm assuming you've already read through the EasyHotSpot 0.2 PDF user guide and followed
its instructions. Here are my comments on the installation process.
I found out that my clients couldn't get an IP address when the DNS servers in /etc/chilli.conf
weren't accurate.
uamallowed in /etc/chilli.conf
If your clients are getting an IP Address but not redirecting to the captive portal login page, then
check uamallowed, that the relevant subnets have been added. To be safe, I added both tunnel
and LAN subnets.
uamallowed 192.168.182.0/24,192.168.1.0/24
I think I may have had to disable the DHCP servers on the interfaces that Chillispot was running
on.
no-dhcp-interface=eth0
sqlcounter max_all_mb patch
sqlcounter max_all_mb {
counter-name = Max-All-MB
check-name = Max-All-MB
reply-name = ChilliSpot-Max-Total-Octets
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT SUM(AcctInputOctets)/(1024*1024) + SUM(AcctOutputOctets)/ (1024*1024) FROM
radacct WHERE UserName='%{%k}'"
}
This, however, somehow didn't work for me. I got some "2043939944 is not an octet" error in
FreeRadius. The problem was that the query converts acctinputoctets and acctoutputoctets to
megabytes, but FreeRadius was expecting bytes. This is what I changed it to:
sqlcounter max_all_mb {
counter-name = Max-All-MB
check-name = Max-All-MB
reply-name = ChilliSpot-Max-Total-Octets
sqlmod-inst = sql
key = User-Name
reset = never
#query = "SELECT SUM(AcctInputOctets)/(1024*1024) + SUM(AcctOutputOctets)/ (1024*1024) FROM
radacct WHERE UserName='%{%k}'"
query = "SELECT SUM(AcctInputOctets) + SUM(AcctOutputOctets) FROM radacct WHERE
UserName='%{%k}'"
}
/etc/freeradius/sites-available/default changes
- chap authentication
#
# The chap module will set 'Auth-Type := CHAP' if we are
# handling a CHAP request and Auth-Type has not already been set
# chap
iptables
If you're logged-in successfully but can't get access to the internet, you most likely need to add
iptables forwarding rules. Here's mine.
IPTABLES="/sbin/iptables"
EXTIF="eth1"
INTIF="eth0"
# squid
$IPTABLES -t nat -A PREROUTING -i tun0 -p tcp --dport 80 -j REDIRECT --to 3128
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to 3128
$IPTABLES -I FORWARD 1 -i tun0 -p tcp --dport 443 -m conntrack --ctstate NEW -j LOG --
log-prefix HOTSPOT:
$IPTABLES -I FORWARD 1 -i eth0 -p tcp --dport 443 -m conntrack --ctstate NEW -j LOG --
log-prefix HOTSPOT:
If you set this up correctly, users won't have to change their browser setting to use your squid
proxy. The proxying will be "transparent" to them.
Here's my squid.conf.
Note the use of url_rewrite to squidguard. You can comment that out if you don't need it.
Here's the shell script I'm using to reset quotas. Additionally, I'm saving the bandwidth usages to
a separate table (radacct_totals) so I have historical usage.
#!/bin/sh
#update radacct_totals
echo 'INSERT IGNORE INTO radacct_totals(username, upload, download, DATE) SELECT
username, acctinputoctets AS uploads, acctoutputoctets AS downloads, DATE(now()) FROM
radacct GROUP BY username' | mysql -u rad radius -B
#truncate radacct_totals
echo 'truncate radacct' | mysql -u rad radius -B
http://www.supermind.org/blog/912/modifying-easyhotspot-0-2-for-daily-per-user-bandwidth-quotas
Trick to "convert" your HTML page to easyhotspot Login
page
Can you imagine that the HTML page that you like can be "converted" into the login page easyhotspot?
Thanks to mas Vcool who provided hotspotlogin.php file on viewtopic.php?f=9&t=328. That's very
helpful!
Now all you have to do is do a trick it into an HTML page to combine with hotspotlogin.php file.
Here's the trick:
Do you realize that all double quoted mark (") always begins with the backslash (\)?. That's the main
trick !! So, after you create your own charming page (with whatever HTML editor you want), just do the
"Find and Replace" (I love CTRL+H). Find the quotation mark (") and replace it with plus backslash (\)
before that (\").
Now it's time to test it. Go to your computer/laptop client, then connect it, VOILA !!! The login
page is your HTML Page !!!
ps.
Here is the example login page that I've converted (thanks to arulsr for permitting me to post it in
this forum). The HTML source is the index.html , then I combine it with hotspotlogin.php. You
can download it on http://www.smk-karya-budi.sch.id/data/zip/login.zip
http://easyhotspot.inov.asia/forum/viewtopic.php?f=9&t=558