ChurchMedic

ChurchMedic random header image

OpenWrt

Linksys WRT54GS + OpenWRT + ChillSpot + FreeRadius (with Mysql authentication and accounting ) + PHP/Perl


Before you start

I would recommend you need to know/read

 

very Brief introduction

OpenWrt is a Linux distribution for Linksys WRT54G. It provides minimal firmware with add-on packages. Its allows the customization with broad range of software packages available for it.
We will be using OpenWrt as a replacement to the original Linksys firmware that comes pre-installed with the router. Linksys used Linux on the WRT54G - and therefore had to provide the source - thus making it possible to hack these routers and make them usefull beyond belief.

ChilliSpot is a wireless LAN access controller. It is used for authenticating users of wireless LAN. It supports web based login for hotspots. Please note - The Chilli daemon plays a primary role in the entire hotspot setup. It runs on the router and provides users access to the wireless Hotspot.

FreeRadius is a server that manages remote user authentication and accounting.

Mysql is a premier opensource database server: All user database, authentication and accounting is stored in a Mysql database.

Setting up the Linksys router

I used the Linksys WRT54GS routers for this setup. For other supported routers see :
http://wiki.openwrt.org/OpenWrtDocs/Installing

We need to install OpenWrt on the router. This is done by flashing the pre-installed Linksys firmware with openwrt.

You may find the procedure to do this is a bit complex depending on your skills.

You may need to downgrade the linksys firmware to enable boot_wait. To do this

1. Download this firmware from here

wget ftp://ftp.linksys.com/pub/network/WRT54GS_3.37.2_US_code.zip on your computer.

2. The Ethernet cable should be connected to the PORT 1 of the router.

3. Point your browser to the Linksys Web administration panel, usually its http://192.168.1.1 and goto the Admin Page -> Upgrade firmware link

4. upload the above firmware.

5. Once you have successfully downgraded the firmware, navigate to Administration -> Diagnostics -> Ping test

6. Enter exactly each line listed below, one line at a time into the “IP Address” field, pressing the Ping button after each entry.

;cp${IFS}*/*/nvram${IFS}/tmp/n
;*/n${IFS}set${IFS}boot_wait=on
;*/n${IFS}commit
;*/n${IFS}show>tmp/ping.log

7. When you get to the last command the ping window should be filled with a long list of variables including boot_wait=on somewhere in that list.


8. Now you are ready to install the actual openwrt firmware. You need a TFTP client for this.

9. Download the openwrt firmware

wget http://downloads.openwrt.org/whiterussian/rc3/bin/openwrt-wrt54gs-jffs2.bin

The basic procedure of using a tftp client to upload a new firmware to your router

1. unplug the power to your router

2. start your tftp client

give it the router’s address (usually 192.168.1.1)

set mode to octet

tell the client to resend the file, until it succeeds.

put the file

3. plug your router, while having the tftp client running and constantly probing for a connection.

4. the tftp client will receive an ack from the bootloader and starts sending the firmware

Please be patient, the reflashing occurs AFTER the firmware has been transferred. DO NOT unplug the router, it will automatically reboot into the new firmware. These steps have to be done in quick succession.

A typical tftp session look like this

tftp 192.168.1.1s

tftp> binary
tftp> trace
Packet tracing on.
tftp> put openwrt-wrt54gs-jffs2.bin

On windows you may try this to tftp

tftp -i 192.168.1.1 PUT openwrt-wrt54gs-jffs2.bin

from the command prompt.

On routers with a DMZ led, OpenWrt will light the DMZ led while booting, after bootup it will turn the DMZ led off. Sometimes automatic rebooting does not work, so you can safely reboot after 5-10 minutes.

If everything up to this point goes fine, we are ready to use the router with the new openwrt.

Next

 

 

No Comments

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment