Open Source Wifi Hotspot Implementation
Open Source Wifi Hotspot Implementation
Open Source Wifi Hotspot Implementation
The goal of this paper is to describe a design—includ- other hardware. The routing functions of the WRT54GS
ing the hardware, software, and configuration––for an were not used in this implementation. The servers need not
be anything special; older hardware will work just fine. For
open source wireless network. The network designed will this implementation, decommissioned 900 MHz units with
require authentication. While care will be taken to keep 512MB of RAM and 40GB hard drives were used.
the authentication exchange secure, the network will oth-
erwise transmit data without encryption.
N Wireless router software
W
ireless networks are an essential tool for provid-
ing service for colleges and libraries. This paper In order to provide the functionality required, the units
will explain the setup of a wireless network had their firmware flashed with an open-source, Linux-
using open-source software and inexpensive commodity based operating system available from OpenWrt for the
hardware. Open-source software was employed exclu- Linksys routers (http://www.openwrt.org). Support is also
sively. This allowed for flexibility in design and reduction available for other wireless devices. “The firmware from
in expense while also providing a platform for students to OpenWrt provides a fully writable file system with pack-
learn more about the internal workings of the system by age management. This allows developers the freedom to
examining particular sections of code in which they have customize the devices by choosing only the packages and
interest. Standard commodity hardware was used as a software that are necessary for their applications.”1 As the
means of saving cost. This should allow others to repeat routers have limited storage, being able to hand select only
this design with a minimum of funding. the necessary components is a definite advantage.
The purpose of a network, like any resource, is to
provide a service for those who own it; in this case, the
patrons of a library, or students, faculty, and staff at a col-
lege. To ensure that this network serves its owners, users
will be required to authenticate before gaining access.
N Server software
Once authenticated, the central captive portal can pro- For the operating system on the servers, Fedora Core
vide different levels of service for specific user groups, was chosen.2 Fedora provides the Yellow Dog Updater,
including guest access, if desired. For this system, ease Modified (yum), which eases the updating of all pack-
of access for users was the primary concern; other than ages installed on the system, including kernel updates.3
using the Secure Socket Layer for authentication, the This aids security by providing a platform for easily and
remainder of the traffic was unencrypted. frequently updating the system. Fedora Core is an open-
Other than the base nodes, the remaining access points source distribution that is available for free. Fedora Core
were connected to each other using a wireless connection also comes with many other open-source packages that
in order to avoid physically connecting all access points were used in this design, such as the Apache Web server.
across campus and to further reduce the expense for the While the designers had more familiarity with Fedora,
deployment of the network. This was accomplished using other distributions are also available that provide simi-
the WDS (wireless distributed system) feature on the lar benefits (Suse, Ubuntu, OpenBSD, Debian, etc.). The
wireless routers. All access points connect to a centralized server was run in command line mode with no graphical
set of servers that provide: DHCP, Web-caching proxy, user interface in order to reduce the load on the server
DNS caching, radius, Web server, a captive portal, and and save space on the hard drive.
logging of network traffic.
N Hardware
N Captive portal
In order to require authentication before gaining access
Requirements for the network were relatively modest, to the network, a captive portal was used. Some of the
using inexpensive wireless routers along with several
Linux servers built upon older Pentium 3 desktop systems.
Linksys WRT54GS routers were chosen as the access points
as they are inexpensive, readily available, and possess the Jim Feher ([email protected]) is an Associate Professor
ability to run custom open-source firmware. Other access of Computer Science at McKendree College in Lebanon, Illinois.
points could be used; however, the configuration sugges- Tyler Sondag ([email protected]), is a senior in
tions are specific to the WRT54GS and may not apply to Computer Science at McKendree College.
N Server installation
The second server required significantly more setup to
configure all of the necessary services that it runs. The
first service added for this implementation was the Web-
Installing the operating system (Fedora Core) on each caching proxy server, Squid. Squid’s default configura-
server is a relatively straightforward procedure. Each tion file (/etc/squid.conf) is quite large; fortunately it
machine was partitioned with 1024 MBs of swap space requires little modification to get a simple server up and
with the rest of the drive being an ext3 partition with running.9 The changes made for this implementation can
the mount point “/”. Only the minimal set of packages be seen in appendix D. The most important lines in this
required were installed at this time. The first server, configuration are the last few, which enable it to act as a
server #1 (router), was given three network interfaces, transparent proxy server, making it invisible to the users
one for the Internet connection, one to connect to a switch and requiring no setup of their browsers.
that then connects to server #2 (Web/DNS caching and As there was no need for an authoritative DNS server,
radius) as well as other machines that do not connect just DNS caching for the network, dnsmasq, which is
through the captive portal, and one connecting to server easy to configure and can handle both DHCP services as
#3 (captive portal machine). The second server, server #2, well as DNS caching, was chosen.10 In this instance, the
only needs one interface, but the third, server #3, requires captive portal was used to provide DHCP services for the
two interfaces, one for the master wireless access point, wireless clients; however dnsmasq was used for dynamic
and one to connect to the switch connecting this machine clients on the remaining portion of the network. Dnsmasq
N Server #3 configuration
entry must exist in the radius configuration file for each
IP/physical address combination.
For this setup, the redirect page was placed on this
The third server required the installation of the captive server, therefore Apache (using yum) was also installed,
portal software, in this case Chillispot. In order to install and this server’s address was added as the Web address
Chillispot, if Fedora was used for the base system, it may for the redirect page (also note that the https module may
be possible to install it as a prepackaged binary in the be required for apache if it does not automatically install).
form an RPM package manager (rpm) file. Otherwise, if Rather than write a new page at this time, the sample
you find that you need to compile Chillispot from source page (hotspotlogin.cgi) from the Chillispot source folder
code, you may need to deviate from a minimal installa- was copied and modified slightly (appendix H). In addi-
tion of the operating system and base components and tion, a Secure Socket Layer (SSL) certificate was installed
also include the GNU compiler collection (gcc). on this server. This is not necessary, but it helps to avoid
When installing from source code, first download the the warnings that pop up when a client attempts to access
code from the Chillispot Web site. Once the code is down- the login page with a browser.
loaded, unzipped and untarred, installing the Chillispot A few iptables rules need to be added. The first com-
daemon is done by entering the directory containing the mand needs to be executed in order to utilize Network
source files and entering the standard commands: Address Translation (NAT) and have the server forward
packets to the outside network.
./configure
/sbin/iptables -t nat -A POSTROUTING -o eth0 \
make
-j MASQUERADE
make install
The next is used to drop all outbound traffic originating
When Chillispot is on the system, either by compiling from the access points. This prevents anyone spoofing
from source or through an rpm file, two more files must the physical address of the access point from accessing
In the “address” box put the following commands in ## Sample configuration for a few access points.
one at a time and click on “ping”; ## Uncomment and run for the appropriate node.
if you see the message that the host was unreachable ## Make sure to
you have done something wrong. ## add a line for every access point you have.
N After the last command you will see a list of all the ## UNIQUE for lib02
nvram settings on the router, make sure that the line ## allow connections to/from lib01
for "boot_wait" is set to on #nvram set wl0_wds=”00:11:22:33:44:22”
N Unplug the router (the Linksys router will only look
for new firmware on boot). ## UNIQUE for lib03
N Use tftp on your Linux or Windows machine. ## allow connections to/from lib01
N If the openwrt0-wrt54gs-squashfs.bin file is not in #nvram set wl0_wds=”00:11:22:33:44:22”
this directory, copy the file to this directory
N Run the following commands at the prompt (below ## SAME for all
are the Linux commands) nvram commit
References
Appendix J. Nvram script for 1. Thomas Eastep, “Port Knocking and Other Uses of ‘Recent
wireless routers Match.’” www.shorewall.net/PortKnocking.html (accessed
Aug. 11, 2006)
## server information stored as comments 2. Ibid.
##192.168.182.10 mainap 00:11:22:33:44:00 3. OpenWrtDocs/Installing-OpenWrt, wiki.openwrt.org/
##192.168.182.11 cl202a 00:11:22:33:44:11 OpenWrtDocs/Installing (accessed Aug. 2, 2006).
##192.168.182.20 lib01 00:11:22:33:44:22