LaFonera Software Chilispot

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:26, 23 February 2007 (edit)
Julien (Talk | contribs)
(La Fonera Chilispot and second virtual SSID)
← Previous diff
Current revision (09:44, 11 April 2011) (edit) (undo)
Anzorik (Talk | contribs)
m (The original Idea)
 
(35 intermediate revisions not shown.)
Line 1: Line 1:
-You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[LaFonera|LaFonera]] / [[LaFonera_Software|Software]] / Chilispot'''+[[Category:LaFonera_Software_(en)]]
-== La Fonera Chilispot and second virtual SSID ==+You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[LaFonera_(en)|LaFonera]] / [[:Category:LaFonera_Software_(en)|Software]] / Chilispot'''
-<b>SCENARIO:</b> 
-When version 24 of DD-WRT was released in beta, one of the first things I wanted to accomplish was to setup FON on 1 SSID and my internal network on another SSID. It took me a while to find the time to work on it but here is how I set it up. I tested this on a WRT54G v4, WRT54GS v1 and a Buffalo WHR-G54S running WPA and WEP for the internal network security.+== Summary ==
-Please note that for some reasons this not seems to work on LA FONERA itself.+
-<b>STEPS:</b>+This howto will enable you to convert the LaFonera into an access point to use with wifi-cpa.com or any other AAA service that makes use of Chillispot, but its key focus shall be on Wifi-CPA, whilst the ddwrt firmware for the LaFonera is still under development and is working great for the most part, the Chillispot portal software crashes due to an unknown (to me anyhow) bug (?memory leaks) at the time of writing (18 June 2007). I would also like to mention that I am in no way affiliated/bribed/blackmailed by FON Wireless LTD, Wifi-CPA, DD-WRT, Chillispot or any political party.
-1. Install the v.24 dd-wrt standard beta version (we are using the 2006-0911 release) of firmware available HERE -- Instructions for installing DD-WRT on the WRT54G or GS are available HERE 
-2. Logon to the web management interface in DD-WRT. Click the Wireless tab, under the Virtual Interfaces click the Add button.+== Preparation ==
-3. Set the Physical Interface SSID and the set Virtual Interface SSID to FON_HotSpot. Enable AP Isolation and set the Network Configuration to Unbridged. Scroll to the bottom and select Save Settings. +You'll need the following for this tutorial:
-[[Image:step3.gif]]+# A LaFonera! 21xx models as the 22xx use a different memory allocation!
 +# SSH client: Putty .
 +# A FON kernel and root.fs hacked to write on the MTD partition with RedBoot, the 2 files that are needed are here and here (only download if you plan to setup a http/ftp server locally, which is outside the scope of this howto).
 +# A recent kernel and root.fs build of ddwrt for atheros WiSOC based hardware, I used root.fs and vmlinux.bin.l7 ((06/10/07) std (SVN revision 7213).
 +# Klever PumpKIN TFTP server/client from here .
 +# A functioning Chillispot mips package from here .
 +# An account with www.wifi-cpa.com and you will also need the unique code that is generated once you've created a hotspot which will have the format XXX-XXXX.
 +# This is not really necessary but worth having,
 +#* patience,
 +#* no one bugging you during any part of this guide,
 +#* a hammer in case of point (b),
 +#* a swiss bank account,
 +#* some refreshments.
-4. The IP Address and Subnet Mask fields should now be present at the bottom of the form. Enter the IP Address of 192.168.181.1 and a subnet mask of 255.255.255.0. Scroll to the bottom and select Save Settings. 
-[[Image:step4.gif]]+== Flashing ==
-5. Click the Wireless Security sub-tab. Change the Security Mode for the Physical Interface to what ever security you want to use for your LAN. (On the FON interface the the Security Mode should remain at disabled.) Scroll to the bottom and select Save Settings.+1. Start with a stock LaFonera, with the original firmware (7.x). If you're unsure of your version, with the power on, hold down the reset button on the bottom of the unit for up to 30 seconds. This should reset it to the original firmware.
-[[Image:step5.gif]]+2. Enable the built-in SSH server on the LaFonera :-)
-6. Click the Administration tab and click the Info Site Password Protection check box. Scroll to the bottom and select Save Settings. 
-[[Image:step6.gif]]+[[Image:LaFonera_Software_Chillispot_-_01_fonfirmware_routerstatus.gif]]
-7. Click the Hotspot sub-tab. Verify that Chillispot is set to Disable. Scroll to the bottom and select Save Settings. 
-[[Image:step7.gif]]+Log into the web administration page for your LaFonera, go to the advanced tab, then internet connection, change the mode from DHCP to static IP from the dropdown option, set an IP and netmask within your modem/routers range, set the gateway to your modem/router IP and change the name server (DNS) of your La Fonera to 88.198.165.155.
-8. Click the Commands sub-tab. Select the following text and paste it into the Commands window. Scroll to the bottom and select Save Startup. 
-<pre>+[[Image:LaFonera_Software_Chillispot_-_02_fonfirmware_internetconnectionsettings.jpg]]
-#!/bin/sh+
-# The following lines create /tmp/chilli.conf 
-echo -n ' 
-dhcpif ath0.1 
-radiusserver1 radius01.fon.com 
-radiusserver2 radius02.fon.com 
-radiussecret garrafon 
-# adminuser=chillispot # chillispot: unrecognized option `--adminuser=chillispot' 
-# adminpasswd=chillispot 
-uamserver https://login.fon.com/cp/index.php # login.fon.com = 213.134.45.152  
-uamsecret garrafon 
-uamallowed www.fon.com,acceso.fon.com,www.paypal.com,www.paypalobjects.com 
-net 192.168.182.0/24 
-dynip 192.168.182.0/24 
-' > /tmp/chilli.conf 
-echo -n radiusnasid `nvram get ath0.1_hwaddr|sed -e radiusnasid -e s/:/-/g`>>/tmp/chilli.conf+Hit submit and reboot your LaFonera (unplug power and back in again). Now you should be able to connect via SSH. This should work with other firmwares, too. Please change the name server according to your ISP or network setup after the reboot.
-## We need to wait 5 seconds (10sec. for Fonera) to make sure we have our WAN DHCP lease and DNS info.+3. Connect via SSH to the LaFonera, and execute the following commands:
-sleep 10+
-## get the first two entries of DNS- Server out of Setup-->Basic Setup-->Network Address Server Settings (DHCP):+ cd /tmp
-echo `nvram get wan_dns` | sed -e 's/[0-9]/=&/' -e 's/ /%/' -e 's/=/\ndns1 /' -e 's/%/\ndns2 /' >> /tmp/chilli.conf+ wget http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
 + mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
 + reboot
-#+After the "reboot" command, the LaFonera will reboot and you'll lose the connection.
-### The following statement adds a statement to cron.d that runs a heartbeat to fon each night at 2am.+
-#echo '00 02 * * * root /usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0.1_hwaddr|sed s/:/-/g`" -O #/#tmp/inet.html' > /tmp/cron.d/heartbeat+
-#+
-### Runs the heartbeat to fon at startup.+
-#/usr/bin/wget "http://download.fon.com/heartbeat.php?mac=`nvram get ath0.1_hwaddr|sed s/:/-/g`"+
-#sleep 15+
-#+
-## Execute chillispot+Don't be misled by the name of the file. This is actually a FON kernel hacked to write on the MTD partition with RedBoot. After this step the LaFonera should be able to restart without any problems. In case you are not able to connect to the Internet from the LaFonera, you can download the files locally, install an FTP or HTTP server on your PC and wget the files from the PC by entering the local server IP.
-/usr/sbin/chilli --conf /tmp/chilli.conf+
-</pre>+
-9. Again, select the following text and paste it into the Commands window. Scroll to the bottom and select Save Firewall. (You can change the DOWNLINK and UPLINK settings in the text below to whatever bandwidth you want to be available to your FON users. Setting is in kbit/s)+4. Again connect via SSH to the LaFonera, and execute the following commands. (Note: Your LaFonera will not boot past RedBoot anymore after this step.)
-<pre>+ cd /tmp
-#!/bin/sh+ wget http://fonera.info/camicia/out.hex
 + mtd -e "RedBoot config" write out.hex "RedBoot config"
 + reboot
-iptables -I INPUT -i tun0 -j ACCEPT+5. Your LaFonera should not be able to completely boot, because the FIS directory will be erased. However, you should be able to connect to the RedBoot prompt. To connect to RedBoot you need to:
-iptables -I FORWARD -i tun0 -o vlan1 -m state --state NEW -j ACCEPT+
-iptables -I FORWARD -i tun0 -o ppp0 -m state --state NEW -j ACCEPT+
-iptables -I FORWARD -i br0 -o tun0 -j logdrop+
-iptables -A FORWARD -i tun0 -j DROP;+:a) Configure your PC so you have an address like 192.168.1.166, netmask 255.255.255.0, gateway and DNS can be left blank.
-iptables -t nat -I PREROUTING -i tun0 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -j DROP+
-DEV="tun0"+:b) Connect your PC and the LaFonera through a crossover ethernet cable or a switch and 2 normal cables (note: you can connect to LaFonera with either a normal cat5 ethernet cable, or with a crossover cable, as La Fonera's NIC is auto-sensing).
-DOWNLINK="768"+
-UPLINK="64"+
- +
-tc qdisc del dev $DEV root+
-tc qdisc del dev $DEV ingress+
- +
-# limit download+
-tc qdisc add dev $DEV root handle 1: htb+
-tc class add dev $DEV parent 1: classid 1:1 htb rate ${DOWNLINK}kbit burst 6k+
-tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst 192.168.182.1/24 flowid 1:1+
- +
-# limit upload+
-tc qdisc add dev $DEV ingress handle ffff:+
-tc filter add dev $DEV parent ffff: protocol ip u32 match ip src 0.0.0.0/0 police rate ${UPLINK}kbit burst 10k drop flowid :1+
-</pre>+
-10. Click the Management sub-tab and scroll to the bottom and click the Reboot Router button.+Load up putty and set the address and port to the following: 192.168.1.254 9000
-11. Now connect to your router via the FON ssid and login to fon.com. Login or create your fon.com account. Once your router is registered your setup should be complete. 
-Good luck! (Don't forget to go to the Management sub-tab and change your routers password.)+[[Image:LaFonera_Software_Chillispot_-_03_putty_configuration.jpg]]
-* Just a note... the drivers on some wireless cards handle the multi SSIDs differently. On some cards when connected to 1 of the SSIDs won't display the other SSID. Just disconnect from the currently connected SSID and you should be able to see both SSIDs. 
-(The text on this Wiki-page was taken from http://www.geek-pages.com/articles/latest/dd-wrt_-_multiple_ssids_-_1_for_fon_-_1_for_private_network.html)+:c) Disconnect and reconnect the power to your LaFonera. Then click open on putty. You have the first 8 secs to access to RedBoot via a plain Telnet connection. (I would avoid using the built in windows telnet client as it seems to give me no joy, just an ascii character.)
 +If everything goes well you should have a "RedBoot>" prompt in telnet.
-original fon firmware /etc/chili.conf+[[Image:LaFonera_Software_Chillispot_-_04_putty_shell.jpg]]
-<pre>+
-radiusserver1 radius01.fon.com+
-radiusserver2 radius02.fon.com+
-radiussecret garrafon+
-dhcpif eth1+
-uamsecret garrafon+
-uamanydns+
-uamallowed www.martinvarsavsky.net,www.google.com,www.flickr.com,static.flickr.com,video.google.com,216.239.51.0/24,66.249.81.0/24+
-uamallowed www.fon.com,www.paypal.com,www.paypalobjects.com,www.skype.com,66.249.93.0/24,72.14.207.0/24,72.14.209.0/24,84.96.67.0/24,213.91.9.0/24,80.118.99.0/24+
-uamallowed shop.fon.co.kr,secure.nuguya.com,inilite.inicis.com,fon-en.custhelp.com,maps.fon.com,c20.statcounter.com+
-uamserver https://login.fon.com/51749e3ba302a6c140f50441bb6df951/cp/index.php+
-</pre>+
-original fon firmware /etc/init.d/N50chillispot 
-<pre> 
-#!/bin/sh 
-. /tmp/network-config 
-TMP_C=/tmp/chilli.conf+Thats enough "point & click" for now, now the exciting parts.
-ETC_C=/etc/chilli.conf+
-PID_F=/var/run/chilli.pid+
-PID_LOOP_F=/var/run/chilli_loop.pid+
-LOG_LOOP_F=/var/log/chilli_loop.log+
-WANIP="$(ifconfig "$wan_ifname" | grep inet | awk -F'[: ]+' '{print $4}')"+
-MAC=$(ifconfig wifi0 | head -n1 | awk '{print $5}'|sed s/:/-/g)+
-MAC=${MAC:-fon}+
-LOOP=true+
-DELAY=86400+
-SECONDS=0+
-DELAY2=10+
-SECONDS2=0+
-RADIUSSERVER=radius01.fon.com+6. You should have Klever PumpKIN and the firmware files from the "Preparation" section, points 4 & 5 respectively.
-RADIUSSECRET=garrafon+
-RADIUSADMUSR=chillispot+
-RADIUSADMPWD=chillispot+
-quit()+:a) Create a folder on your desktop, call it TFTPROOT, move both root.fs and vmlinuz.bin.l7 in to this folder.
-{+
- LOOP="false"+
- circular_log $LOG_LOOP_F "Signal caught. Exiting..."+
-}+
-circular_log() {+:b) Load up PumpKIN, click on "Options", in the "TFTP filesystem root (download path)" browse to the TFTPROOT directory created in the previous step and click "OK"
- echo "chillispot $(date) $2" >> $1+
- tail -24 $1 > $1.tmp+
- mv $1.tmp $1+
-}+
-do_reload() {+7. Configure RedBoot for local IP address and TFTP server in telnet, so in putty you would issue the following command:
- [ -f $PID_F ] && kill -HUP $(cat $PID_F) >/dev/null 2>&1+
-}+
-is_alive() {+ ip_address -l 192.168.1.254/24 -h 192.168.1.166
- if [ ! -f $PID_F ]; then+
- echo "dead"+
- return 0+
- fi+
- TEST_PID=$(cat $PID_F)+
- if [ ! -d /proc/$TEST_PID ]; then+
- rm $PID_F+
- echo "dead"+
- return 0+
- fi+
- CANDIDATE=$(cat /proc/$TEST_PID/status | grep Name: | awk '{ print $2 }')+
- if [ "$CANDIDATE" = "chilli" ]; then+
- echo "alive"+
- return 0+
- else+
- rm $PID_F+
- echo "dead"+
- return 0+
- fi+
-}+
-radconfig() {+8. Run the following commands below in putty. (IMPORTANT: The "fis create" commands below will take a while, do not disconnect while waiting.)
- /usr/sbin/chilli_radconfig \+
- -c /dev/null \+
- --radiusserver1="$RADIUSSERVER" \+
- --radiussecret="$RADIUSSECRET" \+
- --adminuser="$RADIUSADMUSR" \+
- --adminpasswd="$RADIUSADMPWD" \+
- --radiusnasid="$MAC" \+
- --dhcpif $wifi_ifname \+
- > $TMP_C+
- [ -n "$(cat $TMP_C)" ] && {+
- MD5SUM_TMP=$(md5sum $TMP_C | awk '{ print $1 }')+
- MD5SUM_ETC=$(md5sum $ETC_C | awk '{ print $1 }')+
- if [ ! "$MD5SUM_TMP" = "$MD5SUM_ETC" ]; then+
- rm $ETC_C+
- mv $TMP_C $ETC_C+
- circular_log $LOG_LOOP_F "RELOAD"+
- do_reload+
- else+
- circular_log $LOG_LOOP_F "NO RELOAD"+
- fi+
- return 0+
- }+
- circular_log $LOG_LOOP_F "NO RELOAD"+
-}+
-case $1 in+ fis init
- restart)+ load -r -v -b 0x80041000 root.fs
- ALIVE=$(is_alive)+ fis create -b 0x80041000 -f 0xA8030000 -l 0x002C0000 -e 0x00000000 rootfs
- if [ $ALIVE = "alive" ]; then+ load -r -v -b 0x80041000 vmlinux.bin.l7
- exit 0+ fis create -r 0x80041000 -e 0x80041000 -l 0x000E0000 vmlinux.bin.l7
- fi+ fis create -f 0xA83D0000 -l 0x00010000 -n nvram
- /sbin/insmod tun >/dev/null 2>&1+
- ifconfig $wifi_ifname 0.0.0.0 # deconfigure the wifi interface+
- /usr/sbin/chilli \+
- --dns1="$WANIP" \+
- --dns2="$WANIP" \+
- --radiusnasid="$MAC" \+
- --dhcpif $wifi_ifname \+
- --pidfile=$PID_F+
- circular_log $LOG_LOOP_F "RESTART"+
- ;;+
- start)+Each "fis create" commands take up to 10 minutes or so to complete, so be patient before typing the next command! Also with each "load" command, PumpKIN will inform you that the LaFonera is trying to access a file, you must "Grant" access. There will be no output in the terminal window after the programming starts until the programming cycle has been completed. This is normal, don't panic.
- ALIVE=$(is_alive)+
- if [ $ALIVE = "alive" ]; then+
- exit 0+
- fi+
- radconfig+
- /sbin/ifup hotspot+Once the last fis command has finished, you will be at the Redboot prompt again. Run this command in putty to reboot.
- /etc/init.d/S60redirect stop+
- /sbin/insmod tun >/dev/null 2>&1+
- ifconfig $wifi_ifname 0.0.0.0 # deconfigure the wifi interface+
- /usr/sbin/chilli \+
- --dns1="$WANIP" \+
- --dns2="$WANIP" \+
- --radiusnasid="$MAC" \+
- --dhcpif $wifi_ifname \+
- --pidfile=$PID_F+
- if [ $? -eq 0 ]; then+
- $0 loop &+
- fi+
- circular_log $LOG_LOOP_F "START"+
- ;;+
- radconfig)+
- radconfig+
- ;;+
- stop)+ reset
- /sbin/ifdown hotspot+
- ALIVE=$(is_alive)+
- if [ ! $ALIVE = "alive" ]; then+
- echo ERROR: chillispot is not running+
- [ -f $PID_LOOP_F ] && kill $(cat $PID_LOOP_F) > /dev/null 2>&1+
- rm -f $PID_LOOP_F > /dev/null 2>&1+
- exit 0+
- fi+
- [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1+
- rm -f $PID_F+
- [ -f $PID_LOOP_F ] && kill $(cat $PID_LOOP_F) > /dev/null 2>&1+
- rm -f $PID_LOOP_F+
- circular_log $LOG_LOOP_F "STOP"+
- ;;+
- loop)+9. Go make a cup of tea or whatever refreshments you prepared for yourself.
- trap quit SIGINT SIGTERM SIGHUP SIGKILL+
- echo $$ > $PID_LOOP_F+
- while [ $LOOP = "true" ] ; do+
- sleep 1+
- SECONDS=$(expr $SECONDS + 1)+
- if [ "$SECONDS" = "$DELAY" ]; then+
- radconfig+
- fi+
- SECONDS2=$(expr $SECONDS2 + 1)+
- if [ "$SECONDS2" = "$DELAY2" ]; then+
- $0 restart+
- SECONDS2=0+
- fi+
- done+
- exit 0+
- ;;+
- reload)+
- do_reload+
- exit 0+
- ;;+
- alive)+
- ALIVE=$(is_alive)+
- echo "chillispot is $ALIVE"+
- if [ $ALIVE = "alive" ]; then+
- exit 1+
- fi+
- exit 0+
- ;;+
- *)+
- echo "usage: $0 (start|stop|radconfig|reload)"+
- exit 1+
-esac+
-</pre>+
 +Your LaFonera should have been flashed and would have rebooted successfully, by default it will DHCP an external IP address, start an open wireless network called "DD-WRT" and have management at http://192.168.1.1(on port 80). The default username is "root" and the default password is "admin".
-original fon firmware /tmp/network-config+ 
-<pre>+== Configuring ddwrt for Wifi-CPA ==
-wan_ifname=eth0+ 
-lan_ifname=ath1+Connect to the "DD-WRT" wireless signal and browse to the web management at the address given above.
-wifi_ifname=ath0+ 
-config_ifname=eth0+Now go to the "Setup" tab, then click on "Basic Setup", on the "WAN Connection Type" choose "Static IP", now enter an IP and subnet mask within the range of your network, also dont forget to enter your ISP's dns IP(s).
-</pre>+ 
 + 
 +=== Setup/Basic Setup ===
 + 
 + 
 +[[Image:LaFonera_Software_Chillispot_-_05_ddwrt_wansetup.jpg]]
 + 
 + 
 +My own looks like this, for your reference
 + 
 +The DNS IP I have used are from [http://www.opendns.org www.opendns.org] , you can use these, if later on in this tutorial, you find that your hotspot just "hangs" when trying to make a transaction with paypal you know where the problem lies!..................optionally set a "Router Name" and "Hostname".
 + 
 +Next scroll down and you get to the section "Network Address Server Settings (DHCP)" and untick "DHCP-Authoritative".
 + 
 + 
 +[[Image:LaFonera_Software_Chillispot_-_06_ddwrt_networksetup.jpg]]
 + 
 + 
 +Also set up your "Time Zone", "DST" and time "Server IP". then scroll down and click on "Save Settings".
 + 
 + 
 +=== Wireless ===
 + 
 +Next click on the "Wireless" tab and set your "Regulatory Domain" from the drop down list, set your prefered "TX Power" (Max is 18, also depending on which country you select for regulatory domain, it may set the max to 16), scroll down and choose a suitable name for your "Wireless Network Name (SSID) and finally choose a "Wireless Channel" from the drop down list (it is recommended to choose one of three channels, the ones I specify here dont "overlap" and dont cause signal weakness because other AP's in the vicinity, if you live in a remote area, then this does not apply to you, so one of these 3 are fine, channels 1,6, or 11.
 + 
 +Click "Save Settings".
 + 
 + 
 +[[Image:LaFonera_Software_Chillispot_-_07_wlan_channels.gif]]
 + 
 + 
 +For your reference! The 4 thin blue vertical lines represent where channels overlap.
 + 
 + 
 +=== Services ===
 + 
 +Click on the "Services" tab and you should be within another "Services" tab already, you will notice that under "DHCP Server", "Use JFFS for client lease DB" is not mounted, dont worry we will set this up in a few more steps, for now the only thing you change in that particular section is "Used Domain" and set it to "LAN & WLAN", next scroll down to "Secure Shell" and select "Enable", select enable for "Sysem Log and select disable for "Telnet".
 + 
 + 
 +=== Security ===
 + 
 +Click on the "Security" tab and disable "SPI Firewall" then click save settings, click on the next tab named "VPN" and disable "IPSec Passthrough", "PPTP Passthrough" and L2TP Passthrough", then click "Save Settings".
 + 
 + 
 +=== Administration ===
 + 
 +Next we'll click on "Administration" and then "Managment" and then set a suitable "Router Username" and a "Router Password", scroll down and tick the following "HTTPS" on the "Web Access" section, "Use HTTPS" on the "Remote Access" section, "Enable JFFS" and "Clean JFFS" on "JFFS Support" and change the values in "UDP Timeout (in seconds)" to "3600".
 + 
 +Finally, click "Save Settings" and then "Reboot"!
 + 
 + 
 +== Installing & configuring Chillispot ==
 + 
 +a) Now log in to the LaFonera through shell with the username/password you set earlier and type in the following commands:-
 + 
 + cd /tmp
 + ipkg install http://ipkg.hotsplots.de/kamikaze/7.06/atheros-2.6/packages/chillispot_1.1.0-3_mips.ipk
 + 
 +<font color=red>(ILL REMIND YOU, DO NOT ENABLE CHILLISPOT WITHIN THE DDWRT WEB INTERFACE, IT WILL CRASH YOUR AP AND YOU WILL HAVE TO REFLASH TO GET IT UP AND RUNNING AGAIN!)</font>
 + 
 +b) Configure /jffs/etc/chillispot.conf to your own settings, when you get to the section for "dhcpif" use br0
 + 
 + vi /jffs/etc/chilli.conf
 + 
 +Here is a working example of my own chillispot I use with Wifi-CPA
 + 
 + radiusserver1 radius.wifi-cpa.com
 + radiusserver2 radius.wifi-cpa.com
 + radiussecret wificpa
 + dhcpif br0
 + uamserver http://hotspot.wifi-cpa.com/login/
 + dns1 208.67.222.222
 + uamsecret wificpa
 + uamallowed www.paypal.com,www.paypalobjects.com,paypal.112.2o7.net
 + net 192.168.182.0/24
 + radiusnasid PUT YOUR OWN ID HERE (This can be found in your Wifi-CPA profile for the hotspot you're using)
 + uamallowed netweather.accuweather.com,vortex.accuweather.com,wwwa.accuweather.com,www.accuweather.com
 + uamallowed netwx.accuweather.com,maps.google.com,72.14.207.0/24,64.233.167.0/24,12.120.5.14,12.120.37.104
 + 
 +c) Go back to the ddwrt web administration at http://192.168.1.1 and then click on the "Administration" tab and then "Commands" tab.
 + 
 +Paste the following command in to the "Commands" box
 + 
 + /jffs/usr/sbin/chilli -c /jffs/etc/chilli.conf 2>&1 | logger
 + 
 +Then hit "Save Startup" and reboot your LaFonera.
 + 
 +== Testing ==
 + 
 +You have now completed this tutorial, once the LaFonera has rebooted, test it by connecting with your laptop/desktop to the wireless signal DD-WRT or whatever you have set it to be, you should get the IP address in the range of 192.168.182.xx, if you get the IP 192.168.1.xx, then you have messed up somewhere along the way, double check everything outlined on this tutorial.
 + 
 +[[Image:LaFonera_Software_Chillispot_-_08_ddwrt_testing.jpg]]
 + 
 +I must say, I had 6 clients connected at the time of this screenshot and the AP was very very stable!!!
 + 
 + 
 +== The original Idea ==
 +came from http://volubilus.info/
 +visit here [http://www.top5optimizers.com/ PC optimizer tool] and [http://www.top-cleaners.com/ PC Cleaner]
 + 
 + 
 + 
 + 
 +----
 + 
 +this page was made by [[User:wildblue|wildblue!]]

Current revision


You are here: DD-WRT wiki mainpage / LaFonera / Software / Chilispot


Contents

[edit] Summary

This howto will enable you to convert the LaFonera into an access point to use with wifi-cpa.com or any other AAA service that makes use of Chillispot, but its key focus shall be on Wifi-CPA, whilst the ddwrt firmware for the LaFonera is still under development and is working great for the most part, the Chillispot portal software crashes due to an unknown (to me anyhow) bug (?memory leaks) at the time of writing (18 June 2007). I would also like to mention that I am in no way affiliated/bribed/blackmailed by FON Wireless LTD, Wifi-CPA, DD-WRT, Chillispot or any political party.


[edit] Preparation

You'll need the following for this tutorial:

  1. A LaFonera! 21xx models as the 22xx use a different memory allocation!
  2. SSH client: Putty .
  3. A FON kernel and root.fs hacked to write on the MTD partition with RedBoot, the 2 files that are needed are here and here (only download if you plan to setup a http/ftp server locally, which is outside the scope of this howto).
  4. A recent kernel and root.fs build of ddwrt for atheros WiSOC based hardware, I used root.fs and vmlinux.bin.l7 ((06/10/07) std (SVN revision 7213).
  5. Klever PumpKIN TFTP server/client from here .
  6. A functioning Chillispot mips package from here .
  7. An account with www.wifi-cpa.com and you will also need the unique code that is generated once you've created a hotspot which will have the format XXX-XXXX.
  8. This is not really necessary but worth having,
    • patience,
    • no one bugging you during any part of this guide,
    • a hammer in case of point (b),
    • a swiss bank account,
    • some refreshments.


[edit] Flashing

1. Start with a stock LaFonera, with the original firmware (7.x). If you're unsure of your version, with the power on, hold down the reset button on the bottom of the unit for up to 30 seconds. This should reset it to the original firmware.

2. Enable the built-in SSH server on the LaFonera :-)


Image:LaFonera_Software_Chillispot_-_01_fonfirmware_routerstatus.gif


Log into the web administration page for your LaFonera, go to the advanced tab, then internet connection, change the mode from DHCP to static IP from the dropdown option, set an IP and netmask within your modem/routers range, set the gateway to your modem/router IP and change the name server (DNS) of your La Fonera to 88.198.165.155.


Image:LaFonera_Software_Chillispot_-_02_fonfirmware_internetconnectionsettings.jpg


Hit submit and reboot your LaFonera (unplug power and back in again). Now you should be able to connect via SSH. This should work with other firmwares, too. Please change the name server according to your ISP or network setup after the reboot.

3. Connect via SSH to the LaFonera, and execute the following commands:

cd /tmp
wget http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
reboot

After the "reboot" command, the LaFonera will reboot and you'll lose the connection.

Don't be misled by the name of the file. This is actually a FON kernel hacked to write on the MTD partition with RedBoot. After this step the LaFonera should be able to restart without any problems. In case you are not able to connect to the Internet from the LaFonera, you can download the files locally, install an FTP or HTTP server on your PC and wget the files from the PC by entering the local server IP.

4. Again connect via SSH to the LaFonera, and execute the following commands. (Note: Your LaFonera will not boot past RedBoot anymore after this step.)

cd /tmp
wget http://fonera.info/camicia/out.hex
mtd -e "RedBoot config" write out.hex "RedBoot config"
reboot

5. Your LaFonera should not be able to completely boot, because the FIS directory will be erased. However, you should be able to connect to the RedBoot prompt. To connect to RedBoot you need to:

a) Configure your PC so you have an address like 192.168.1.166, netmask 255.255.255.0, gateway and DNS can be left blank.
b) Connect your PC and the LaFonera through a crossover ethernet cable or a switch and 2 normal cables (note: you can connect to LaFonera with either a normal cat5 ethernet cable, or with a crossover cable, as La Fonera's NIC is auto-sensing).

Load up putty and set the address and port to the following: 192.168.1.254 9000


Image:LaFonera_Software_Chillispot_-_03_putty_configuration.jpg


c) Disconnect and reconnect the power to your LaFonera. Then click open on putty. You have the first 8 secs to access to RedBoot via a plain Telnet connection. (I would avoid using the built in windows telnet client as it seems to give me no joy, just an ascii character.)

If everything goes well you should have a "RedBoot>" prompt in telnet.


Image:LaFonera_Software_Chillispot_-_04_putty_shell.jpg


Thats enough "point & click" for now, now the exciting parts.

6. You should have Klever PumpKIN and the firmware files from the "Preparation" section, points 4 & 5 respectively.

a) Create a folder on your desktop, call it TFTPROOT, move both root.fs and vmlinuz.bin.l7 in to this folder.
b) Load up PumpKIN, click on "Options", in the "TFTP filesystem root (download path)" browse to the TFTPROOT directory created in the previous step and click "OK"

7. Configure RedBoot for local IP address and TFTP server in telnet, so in putty you would issue the following command:

ip_address -l 192.168.1.254/24 -h 192.168.1.166

8. Run the following commands below in putty. (IMPORTANT: The "fis create" commands below will take a while, do not disconnect while waiting.)

fis init
load -r -v -b 0x80041000 root.fs
fis create -b 0x80041000 -f 0xA8030000 -l 0x002C0000 -e 0x00000000 rootfs
load -r -v -b 0x80041000 vmlinux.bin.l7
fis create -r 0x80041000 -e 0x80041000 -l 0x000E0000 vmlinux.bin.l7
fis create -f 0xA83D0000 -l 0x00010000 -n nvram

Each "fis create" commands take up to 10 minutes or so to complete, so be patient before typing the next command! Also with each "load" command, PumpKIN will inform you that the LaFonera is trying to access a file, you must "Grant" access. There will be no output in the terminal window after the programming starts until the programming cycle has been completed. This is normal, don't panic.

Once the last fis command has finished, you will be at the Redboot prompt again. Run this command in putty to reboot.

reset

9. Go make a cup of tea or whatever refreshments you prepared for yourself.

Your LaFonera should have been flashed and would have rebooted successfully, by default it will DHCP an external IP address, start an open wireless network called "DD-WRT" and have management at http://192.168.1.1(on port 80). The default username is "root" and the default password is "admin".


[edit] Configuring ddwrt for Wifi-CPA

Connect to the "DD-WRT" wireless signal and browse to the web management at the address given above.

Now go to the "Setup" tab, then click on "Basic Setup", on the "WAN Connection Type" choose "Static IP", now enter an IP and subnet mask within the range of your network, also dont forget to enter your ISP's dns IP(s).


[edit] Setup/Basic Setup

Image:LaFonera_Software_Chillispot_-_05_ddwrt_wansetup.jpg


My own looks like this, for your reference

The DNS IP I have used are from www.opendns.org , you can use these, if later on in this tutorial, you find that your hotspot just "hangs" when trying to make a transaction with paypal you know where the problem lies!..................optionally set a "Router Name" and "Hostname".

Next scroll down and you get to the section "Network Address Server Settings (DHCP)" and untick "DHCP-Authoritative".


Image:LaFonera_Software_Chillispot_-_06_ddwrt_networksetup.jpg


Also set up your "Time Zone", "DST" and time "Server IP". then scroll down and click on "Save Settings".


[edit] Wireless

Next click on the "Wireless" tab and set your "Regulatory Domain" from the drop down list, set your prefered "TX Power" (Max is 18, also depending on which country you select for regulatory domain, it may set the max to 16), scroll down and choose a suitable name for your "Wireless Network Name (SSID) and finally choose a "Wireless Channel" from the drop down list (it is recommended to choose one of three channels, the ones I specify here dont "overlap" and dont cause signal weakness because other AP's in the vicinity, if you live in a remote area, then this does not apply to you, so one of these 3 are fine, channels 1,6, or 11.

Click "Save Settings".


Image:LaFonera_Software_Chillispot_-_07_wlan_channels.gif


For your reference! The 4 thin blue vertical lines represent where channels overlap.


[edit] Services

Click on the "Services" tab and you should be within another "Services" tab already, you will notice that under "DHCP Server", "Use JFFS for client lease DB" is not mounted, dont worry we will set this up in a few more steps, for now the only thing you change in that particular section is "Used Domain" and set it to "LAN & WLAN", next scroll down to "Secure Shell" and select "Enable", select enable for "Sysem Log and select disable for "Telnet".


[edit] Security

Click on the "Security" tab and disable "SPI Firewall" then click save settings, click on the next tab named "VPN" and disable "IPSec Passthrough", "PPTP Passthrough" and L2TP Passthrough", then click "Save Settings".


[edit] Administration

Next we'll click on "Administration" and then "Managment" and then set a suitable "Router Username" and a "Router Password", scroll down and tick the following "HTTPS" on the "Web Access" section, "Use HTTPS" on the "Remote Access" section, "Enable JFFS" and "Clean JFFS" on "JFFS Support" and change the values in "UDP Timeout (in seconds)" to "3600".

Finally, click "Save Settings" and then "Reboot"!


[edit] Installing & configuring Chillispot

a) Now log in to the LaFonera through shell with the username/password you set earlier and type in the following commands:-

cd /tmp
ipkg install http://ipkg.hotsplots.de/kamikaze/7.06/atheros-2.6/packages/chillispot_1.1.0-3_mips.ipk

(ILL REMIND YOU, DO NOT ENABLE CHILLISPOT WITHIN THE DDWRT WEB INTERFACE, IT WILL CRASH YOUR AP AND YOU WILL HAVE TO REFLASH TO GET IT UP AND RUNNING AGAIN!)

b) Configure /jffs/etc/chillispot.conf to your own settings, when you get to the section for "dhcpif" use br0

vi /jffs/etc/chilli.conf 

Here is a working example of my own chillispot I use with Wifi-CPA

radiusserver1 radius.wifi-cpa.com
radiusserver2 radius.wifi-cpa.com
radiussecret wificpa
dhcpif br0
uamserver http://hotspot.wifi-cpa.com/login/
dns1 208.67.222.222
uamsecret wificpa
uamallowed www.paypal.com,www.paypalobjects.com,paypal.112.2o7.net
net 192.168.182.0/24
radiusnasid PUT YOUR OWN ID HERE (This can be found in your Wifi-CPA profile for the hotspot you're using)
uamallowed netweather.accuweather.com,vortex.accuweather.com,wwwa.accuweather.com,www.accuweather.com
uamallowed netwx.accuweather.com,maps.google.com,72.14.207.0/24,64.233.167.0/24,12.120.5.14,12.120.37.104

c) Go back to the ddwrt web administration at http://192.168.1.1 and then click on the "Administration" tab and then "Commands" tab.

Paste the following command in to the "Commands" box

/jffs/usr/sbin/chilli -c /jffs/etc/chilli.conf 2>&1 | logger

Then hit "Save Startup" and reboot your LaFonera.

[edit] Testing

You have now completed this tutorial, once the LaFonera has rebooted, test it by connecting with your laptop/desktop to the wireless signal DD-WRT or whatever you have set it to be, you should get the IP address in the range of 192.168.182.xx, if you get the IP 192.168.1.xx, then you have messed up somewhere along the way, double check everything outlined on this tutorial.

Image:LaFonera_Software_Chillispot_-_08_ddwrt_testing.jpg

I must say, I had 6 clients connected at the time of this screenshot and the AP was very very stable!!!


[edit] The original Idea

came from http://volubilus.info/ visit here PC optimizer tool and PC Cleaner




this page was made by wildblue!