Tag Archive for 'La Fonera'

Page 2 of 2

Tweak your FON Chillispot allowed URL list

Following Ivan’s article about how the La Fonera automatically updates it’s chilli.conf file (Chillispot configuracion file), and about the fact that you may like to configure your own set of allowed URLs — URLs users can browse without registering against FON radius –, I propose here a modification of /etc/init.d/N50chillispot.

With that patch applyed to N50chillispot:
* You can now specify your own set of allowed URLs. Put the lines into /etc/chilli.allowed (create the file). Leave the file blank or remove file if you don’t want to allow any URL.
* You’ll receive any update to the file (radius changes,…) but you won’t be affected by "uamallowed" lines (your lines will apply instead).

Here is the patch I propose:

--- N50chillispot.old   2007-03-05 11:43:53.000000000 +0100
+++ N50chillispot       2007-03-05 12:22:13.000000000 +0100
@@ -2,7 +2,9 @@
 . /tmp/network-config

 TMP_C=/tmp/chilli.conf
+TMP_C_T=/tmp/chilli.conf.tmp
 ETC_C=/etc/chilli.conf
+ETC_W=/etc/chilli.allowed
 PID_F=/var/run/chilli.pid
 PID_LOOP_F=/var/run/chilli_loop.pid
 LOG_LOOP_F=/var/log/chilli_loop.log
@@ -69,6 +71,9 @@
                --dhcpif $wifi_ifname \
                > $TMP_C
        [ -n "$(cat $TMP_C)" ] && {
+               grep -v "^uamallowed" $TMP_C > $TMP_C_T
+               [ -f "$ETC_W" ] && cat $ETC_W >> $TMP_C_T
+               mv $TMP_C_T $TMP_C
                MD5SUM_TMP=$(md5sum $TMP_C | awk '{ print $1 }')
                MD5SUM_ETC=$(md5sum $ETC_C | awk '{ print $1 }')
                if [ ! "$MD5SUM_TMP" = "$MD5SUM_ETC" ]; then

(tested on Fonera Firmware Version 0.7.1 rev 1)

Change your Fonera date and timezone

# echo "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" > /etc/TZ
# ntpclient -c 1 -s -h pool.ntp.org
39143 45854.743  153016.0     25.0  104118.5  43060.3         0
# date
Sun Mar  4 13:44:29 CET 2007

Now the date and timezone is correct.

Reference:
* Timezone at OpenWRT Configuracion wiki

Change your Fonera hostname

The Fonera OS doesn’t bring the hostname command, but you can change it’s default “OpenWrt” hostname to any hostname you like:

# sysctl -w kernel.hostname=fon01
kernel.hostname = fon01
# uname -a
Linux fon01 2.4.32 #9 jue nov 23 12:11:45 UTC 2006 mips unknown

(note: the date is wrong!)

You can make it persistent accross reboot:

echo "kernel.hostname=fon01" >> /etc/sysctl.conf

Shell access (ssh) on your Fonera

Movimiento FONRight after receiving my free La Fonera social router, I plugged it into my local home network, and registred it, as explained in the provided guide. The problem (I knew it later), is that when the Fonera boots, it connects to Fon and upgrades itself (and reconfigures itself also).

So, as I plugged my Fonera to Internet, it upgraded to the latest firmware revision, for which there is no known hack to get ssh shell access.

Today I searched for a way to succesfully downgrade my Fonera to it’s original firmware.

After trying several ways (found on the Internet) with no success, this is the way that finally worked for me:

* Configure your PC with ip 169.254.255.2/24
* Connect your PC and the Fonera with a direct cable (straight or crossover ethernet, doesn’t matter, the Fonera is smart enough)
* Press the reset button (down the fonera) for 20 seconds
* Release the button
* From the PC, ping 169.254.255.1 (As it cannot get any DHCP IP, the Fonera autoconfigure it’s eth0:1 with this zeroconf IP).
* Wait till it’s reachable (approx 2mn)

When the IP is reacheable (when the Fonera answers the ping requests), you can now apply the following hack:

Create on your PC 2 html files, with the following content:

step1.html:





step2.html





Now, open step1.html with your favorite browser and click the submit button (if your are asked for login/passwd, unless you changed it, try admin/admin). Once done, do the same with step2, and submit.

The dropbear ssh deamon should now be open on your Fonera! You can get a shell inside your Fonera: connect by ssh to 169.254.255.1 (port 22): user root and password admin, unless you changed it (the same passwd as the web UI).

Final steps are:

* Activate ssh permanently :

root@OpenWrt:~# mv /etc/init.d/dropbear /etc/init.d/S50dropbear

* Unlock firewalling rules :

root@OpenWrt:~# vi /etc/firewall.user

* Uncomment the following :

iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT
iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT

* Deactivate automatic Fonera updates :

root@OpenWrt:~# vi /bin/thinclient

* Comment the following line (last one) :

#. /tmp/.thinclient.sh

At this point I had some troubles with the Fonera not catching IP by DHCP. By advice of another fonero-geek and friend (Ivan!), I set up the Fonera to use a static IP (using the MyPlace web UI), and everything worked fine. Eventually this morning I changed back the Fonera to get it’s IP by DHCP and it actually worked too.

Some sources that inspired me a lot (and more):
http://imil.net/docs/fonera-ssh.txt
http://blog.blase16.de/2006/11/28/Hacking-Fonera




Close
Powered by ShareThis