Preparation
SSH client
For windows, Putty is a free and popular choice, for Linux or Mac OS you can use the terminal
Telnet client
For Windows, Putty again will work, for Linux or Mac OS you can use the terminal again
Internet access from the Fonera unit for wget, or a local webserver to serve the the latest root.fs and vmlinux.bin.l7 from:
http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fbeta+releases%2Ffonera+builds/
TFTP server software
* Simple tftp server for
windows: http://sourceforge.net/projects/tftp-server/
or http://kin.klever.net/pumpkin/
* If you're running
Linux, here's the simplest cross-distribution way to setup a TFTP server:
Download http://mirror.usu.edu/mirrors/gentoo/distfiles/tftp-hpa-0.48.tar.bz2 and unpack into a
temporary directory. Make sure you have gcc, make, etc installed on your system.
Build tftp-hpa by running ./configure and then make.
Become root (or use sudo) and run ./tftpd/tftpd -s -l [tftpdir] where [tftpdir] is your tftp server directory.
Test with a command-line TFTP client, such as the one that was built with tftp-hpa.
* If you're running
Mac OS X, you can use the integrated tftp server:
Create the tftp server root by typing sudo mkdir /private/tftpboot
Start the server by typing sudo /sbin/service tftp start
Test it by typing tftp localhost then get (filename) where (filename) is the name of a file you have put in
/private/tftpboo
Resetting your FON
First you need to reset your fon if the firmware version is newer than 0.7.1 r1:
- Press the reset button on the bottom of the La Fonera for 5 seconds.
- Reboot the FON
Now your fon uses 0.7.1 r1 (if this trick still works)
If you got a older firmware version, you can skip this part.
Enabling SSH access
Set PC ip to: 169.254.255.2
access MyPlace: 169.254.255.1
First you have to write to two html-pages which will inject code in your Fon-Router. Save the following code as 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 next html code as 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 the both sites and just click on the "Submit" button(first at the step1.html then on the step2.html page). Open your favorite shell and connect to your router via ssh with username root and password admin.
ssh root@192.168.10.1
For enabling a permanent ssh access you have to move dropbear to S50 dropbear:
$> mv /etc/init.d/dropbear /etc/init.d/S50dropbear
Now we have to uncomment two lines
$> vi /etc/firewall.user
Press "i"
And uncomment these lines (removing the #):
# 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
Safe your work by pressing "ESC" and typing ":wq" (write and quit) and pressing ENTER.
La Fonera receives shell code from FON through SSH. This is done by the /bin/thinclient script. We should edit it. If you want to prevent La Fonera from executing that received code, you might want to comment out the final line. If you skip this step you’ll possibly lose SSH access at the next firmware update.
$> vi /bin/thinclient
You have to comment the last line and add another line, so that the last two lines look like this:
#. /tmp/.thinclient.sh
cp /tmp/.thinclient.sh /tmp/thinclient-$(date '+%Y%m%d-%H%M')
Safe your work by pressing "ESC" and typing ":wq" (write and quit) and pressing ENTER. Now you can reboot.
Now you have ssh daemon on your fonera.
Flashing
Connect your Fonera via your router to the internet, after that
connect via SSH to the Fonera
ssh root@192.168.10.1
password is probably 'admin'
Now enter 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.
Again connect via SSH to the Fonera, 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

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:
- Configure your PC so you have an address like 192.168.1.166.
- Connect your PC and the LaFonera through a crossover ethernet cable or a switch and 2 normal cables (note: Many NICs can connect to the Fonera directly with a normal cable, the Fonera may have an autosensing auto-sensing port making a crossover cable unnecessary).
- Disconnect and reconnect the power to your LaFonera. In the first 10 secs you can access to RedBoot via a plain Telnet connection on port 9000.
telnet 192.168.1.254 9000
If everything goes well you should have a "RedBoot>" prompt in telnet.

Download the latest root.fs and vmlinux.bin.l7 from: http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fbeta+releases%2Ffonera+builds/
No matter what you use for a TFTP server, RedBoot will try to fetch the files from the root directory, e.g., /root.fs. Make sure your TFTP server is configured to do this as some are not by default.
Configure RedBoot for local IP and tftp server enter in telnet.
ip_address -l [local ip address/24] -h [remote server address]
Replace "[local ip address/24]" with "192.168.1.254/24" and "[remote server address]" with whatever you entered as the IP address of your TFTP server, 192.168.1.66 in this case. If the local IP address changes from 192.168.1.254 your telnet session will die and you will need to reconnect to the newly enter IP address)
ip_address -l 192.168.1.254/24 -h 192.168.1.66

Run these commands in telnet:
(note: the 'fis create' commands take up to 10 minutes or so to complete, so be patient! 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)
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
Thats it. Your LaFonera should reboot and start DD-WRT. It by default will DHCP an IP address and have management on port 8080.

External Links