Video Tutorial-How to Flash your La Fonera

This video is 12 mins long and 19.5mb...hope it helps

http://www.gettingpumped.com/users/digerati/dd-wrt-fonera/fonera.htm
http://www.gettingpumped.com/users/digerati/dd-wrt-fonera/fonera.txt

=========================================

Ingredients:

You may need a crossover network cable or two normal cables and a hub/switch/router to connect your PC to the LaFonera for the telnet session required later on in this tutorial.

If your network card you're using does support auto-detection of connections, then all you will need is a simple ethernet cable.

If the network card you're using does NOT support auto-detection of connections (newer cards _usually_ do but not always) then you will need a crossover cable, or two normal cables and a hub/switch.

How to make a Crossover Cable (for those that want to make one themselves)
http://www.littlewhitedog.com/content-8.html

Putty
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

TFTPd32
http://tftpd32.jounin.net/

HFS ~ Http File Server
http://www.rejetto.com/hfs/

Internet Explorer

The files root.fs and vmlinux.bin.l7 from a recent build directory
http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fbeta+releases%2Ffonera+builds/

http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
and
http://fonera.info/camicia/out.hex

=========================================

Create on your PC 2 html files, with the following content:
These two html-pages which will inject code in your Fon-Router.
Save the following code as step1.html:

STEP1.html

<html>
<head>
</head>
<body>
<center>
<form method="post" action="http://192.168.10.1/cgi-bin/webif/connection.sh" enctype="multipart/form-data">
<input name="username" value="$(/usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT)" size="68" >
<input type="submit" name="submit" value="Submit" onClick="{this.form.wifimode.value='";' + this.form.wifimode.value +';"'}" />
</form>
</body>
</html>

Save the following code as step2.html:

STEP2.html

<html>
<head>
</head>
<body>
<center>
<form method="post" action="http://192.168.10.1/cgi-bin/webif/connection.sh" enctype="multipart/form-data">
<input name="username" value="$(/etc/init.d/dropbear)" size="68" >
<input type="submit" name="submit" value="Submit" onClick="{this.form.wifimode.value='";' + this.form.wifimode.value +';"'}" />
</form>
</body>
</html>

Now connect to your MyPlace Network, open your browser and just drag and drop the files into your browser and just click on the "Submit" button(first at the step1.html then on the step2.html page). Open putty and connect to your router via ssh with username root and password admin.

====================================
A word about the VI editor.
For those of you that do not know, VI is to linux as notepad is to windows.
It comes loaded by default. All you need to know to complete this tutorial is that pressing the letter i will allow you to edit or place text objects within a file.
After doing so press the esc key to take yourself out of that mode and to write what you changed to the file and quit the vi editor you will use :wq
=====================================

For enabling a permanent ssh access you have to move dropbear to S50 dropbear:

mv /etc/init.d/dropbear /etc/init.d/S50dropbear

In the /etc/firewall.user you have to uncomment these lines:

vi /etc/firewall.user

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

:wq
=====================================
If you cant use the delete key properly to remove the comments, I used the arrow keys to cursor down to the end of each line and backspace over all the following lines and then right clicked and pasted the lines.
=====================================

Now you should prevent Fon from executing received code, by editing /bin/thinclient. You have to comment the last line and add another line, so that the last two lines look like this:

vi /bin/thinclient

(press I )

#. /tmp/.thinclient.sh
cp /tmp/.thinclient.sh /tmp/thinclient-$(date '+%Y%m%d-%H%M')

:wq

Now ssh is enabled on your fonera, and we can proceed with installing DD-WRT on it without the need of a serial cable.
=====================================

Next we will flash the router. The following info was taken from http://www.dd-wrt.com/wiki/index.php/La_Fonera_Flashing.

=====================================

=== all of the following are seperate commands ====

cd /tmp

wget http://192.168.10.199/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma

mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7

reboot

=== give the router a good two or three minutes to reboot ===

=== all of the following are seperate commands ====

cd /tmp

wget http://192.168.10.199/out.hex

mtd -e "RedBoot config" write out.hex "RedBoot config"

reboot

=== give the router a good two or three minutes to reboot ===

Using putty now and the crossover cable attached
telnet 192.168.1.254 9000

=== all of the following are seperate commands ====

ip_address -l 192.168.1.254/24 -h 192.168.1.166

=== all of the following are seperate commands ====
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

reset

Now after a few mintuets when the router has rebooted, you should see dd-wrt in your wireless networks to connect to.

Connect to it, then open your browser and connect to http://192.168.1.1 and enjoy your la fonera flashed with dd-wrt.

Thanks to the entire dd-wrt/lafonera community, wiki posters, brainslayer, joksi, Burnte, nullboy, sorry if I forgot anyone.

====================================================================================

LINKS:
A Guide to Hacking the La Fonera Wireless Router
guide.pdf
Hacking Fonera – How to install dd-wrt onto fonera
hacking the la fonera
fonera – debricking and more
la fonera inside

Advertisements