LaFonera Software Flashing

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 06:29, 17 May 2007 (edit)
Achille (Talk | contribs)
(Flashing)
← Previous diff
Revision as of 12:40, 26 May 2007 (edit) (undo)
Dr. Ongo (Talk | contribs)
m (Typos)
Next diff →
Line 7: Line 7:
# SSH client # SSH client
#*For windows, [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] is a free and popular choice #*For windows, [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] is a free and popular choice
-#*For Mac OS X, ssh is built in. Open Terminal.app and use "ssh".+#*For Mac OS X, SSH is built in. Open Terminal.app and use "ssh".
# Telnet client # Telnet client
#*For Windows, Putty again will work. #*For Windows, Putty again will work.
Line 13: Line 13:
# The files <tt>root.fs</tt> and <tt>vmlinux.bin.l7</tt> from a recent build directory located [http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fbeta+releases%2Ffonera+builds/ here], http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma and http://fonera.info/camicia/out.hex # The files <tt>root.fs</tt> and <tt>vmlinux.bin.l7</tt> from a recent build directory located [http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fbeta+releases%2Ffonera+builds/ here], http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma and http://fonera.info/camicia/out.hex
# A method to serve the above files to the LaFonera. # A method to serve the above files to the LaFonera.
-#* Windows: Run [http://www.rejetto.com/hfs/?f=dl HTTP File Server] on your Windows machine (it's a simple no-installer-needed HTTP server)+#* Windows: Run [http://www.rejetto.com/hfs/?f=dl HTTP file server] on your Windows machine (it's a simple no-installer-needed HTTP server)
-#*Mac OS X: Start up "Personal Web Sharing" in the "Sharing" pane of System Prefernces. Use the "Sites" folder in your home directory to serve files.+#*Mac OS X: Start up "Personal Web Sharing" in the "Sharing" pane of System Preferences. Use the "Sites" folder in your home directory to serve files.
#* Linux: Install Apache from your distribution's package manager. You might want to have a look at [http://linux.bytesex.org/misc/webfs.html webfs] as well. [Simple alternatives welcome] #* Linux: Install Apache from your distribution's package manager. You might want to have a look at [http://linux.bytesex.org/misc/webfs.html webfs] as well. [Simple alternatives welcome]
-#* You '''can''' provide Internet access to the LaFonera unit, but these three are preferred alternatives, as the Fonera may try to auto-update its firmware.+#* You '''can''' provide Internet access to the LaFonera unit, but these three are preferred alternatives, as the LaFonera may try to auto-update it's firmware.
#* Internet access or a webserver is not necessary as long as you can copy the files locally with <tt>scp</tt> to the /tmp of the LaFonera and execute your commands afterwards. #* Internet access or a webserver is not necessary as long as you can copy the files locally with <tt>scp</tt> to the /tmp of the LaFonera and execute your commands afterwards.
# TFTP server software. ''(TFTP is not FTP; these are different protocols. TFTP, unlike FTP, is used primarily for transferring files to and from network equipment (e.g. your router, switch, hub, whatnot firmware upgrade or backup, or configuration backup and restore))'' # TFTP server software. ''(TFTP is not FTP; these are different protocols. TFTP, unlike FTP, is used primarily for transferring files to and from network equipment (e.g. your router, switch, hub, whatnot firmware upgrade or backup, or configuration backup and restore))''
-#*Simple tftp server for Windows: http://sourceforge.net/projects/tftp-server/ or http://kin.klever.net/pumpkin/ or http://www.jounin.net/tftpd32.html+#*Simple TFTP server for Windows: http://sourceforge.net/projects/tftp-server/ or http://kin.klever.net/pumpkin/ or http://www.jounin.net/tftpd32.html
#*If you're running Linux, here's the simplest cross-distribution way to setup a TFTP server: #*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.+#** 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 <tt>./configure</tt> and then <tt>make</tt>. #*# Build tftp-hpa by running <tt>./configure</tt> and then <tt>make</tt>.
#*# Become root (or use sudo) and run <tt>./tftpd/tftpd -s -l [tftpdir]</tt> where <tt>[tftpdir]</tt> is your tftp server directory. #*# Become root (or use sudo) and run <tt>./tftpd/tftpd -s -l [tftpdir]</tt> where <tt>[tftpdir]</tt> is your tftp server directory.
#*# Test with a command-line TFTP client, such as the one that was built with tftp-hpa. #*# 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: #*If you're running Mac OS X, you can use the integrated tftp server:
-#*# Create the tftp server root by typing <tt>sudo mkdir /private/tftpboot</tt>+#*# Create the TFTP server root by typing <tt>sudo mkdir /private/tftpboot</tt>
#*# Start the server by typing <tt>sudo /sbin/service tftp start</tt> #*# Start the server by typing <tt>sudo /sbin/service tftp start</tt>
#*# Test it by typing <tt>tftp localhost</tt> then <tt>get (filename)</tt> where (filename) is the name of a file you have put in /private/tftpboot #*# Test it by typing <tt>tftp localhost</tt> then <tt>get (filename)</tt> where (filename) is the name of a file you have put in /private/tftpboot
Line 41: Line 41:
* For a LaFonera with firmware 0.7.1-1 or before: [http://blog.blase16.de/index.php?url=2006/11/28/Hacking-Fonera over wireless] or [http://uselesshacks.com/?p=23 over Ethernet (easier)] * For a LaFonera with firmware 0.7.1-1 or before: [http://blog.blase16.de/index.php?url=2006/11/28/Hacking-Fonera over wireless] or [http://uselesshacks.com/?p=23 over Ethernet (easier)]
* For a LaFonera with firmware 0.7.1-2 use: http://stefans.datenbruch.de/lafonera/#kolofonium) * For a LaFonera with firmware 0.7.1-2 use: http://stefans.datenbruch.de/lafonera/#kolofonium)
-**''' Easier deployment of the Kolofinum hack: Change the nameserver (DNS) of your La Fonera to 88.198.165.155 and reboot. Now you should be able to connect via SSH. This should work with other firmwares, too. Please change the nameserver according to your ISP or network setup after the reboot. No need to download HTML hacks and manual editing of files no longer.'''+**''' Easier deployment of the Kolofinum hack: Change the name server (DNS) of your La Fonera to 88.198.165.155 and reboot. 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. No need to download HTML hacks and manual editing of files any longer.'''
** ''EVEN EASIER!!! ****** This works on the newest firmware that has been hard-coded on the new chips''' ** ''EVEN EASIER!!! ****** This works on the newest firmware that has been hard-coded on the new chips'''
Line 48: Line 48:
*** Replace power connector and continue holding reset button until "wifi" lights up and goes away again (a good 2-3 minutes of holding it). *** Replace power connector and continue holding reset button until "wifi" lights up and goes away again (a good 2-3 minutes of holding it).
*** Let go and wait for "wifi" to come back (2-3 minutes). *** Let go and wait for "wifi" to come back (2-3 minutes).
-*** Now you may use the "step1.html" and "step2.html" method to turn ssh on as you would with the normal "r1" Fonera. It will still continue to say "r2" on the Fonera status page whilst you enjoy your ssh connection.+*** Now you may use the "step1.html" and "step2.html" method to turn SSH on as you would with the normal "r1" LaFonera. It will still continue to say "r2" on the LaFonera status page whilst you enjoy your SSH connection.
'''3.''' Connect via SSH to the LaFonera, and execute the following commands: '''3.''' Connect via SSH to the LaFonera, and execute the following commands:
Line 61: Line 61:
:Don't be mislead by the name of the file. This is actually a FON kernel hacked to write on the mtd partion with RedBoot. After this step the LaFonera should be able to restart without any problem. 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 <tt>wget</tt> the files from the PC by entering the local server IP. :Don't be mislead by the name of the file. This is actually a FON kernel hacked to write on the mtd partion with RedBoot. After this step the LaFonera should be able to restart without any problem. 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 <tt>wget</tt> 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''']+'''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> <pre>
cd /tmp cd /tmp
Line 69: Line 69:
</pre> </pre>
-'''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:+'''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. *a) Configure your PC so you have an address like 192.168.1.166.
-*b) Connect your PC and the LaFonera through a crossover ethernet cable or a switch and 2 normal cables (''note: you can connect to La Fonera with either a normal Cat-5 ethernet cable, or with a crossover cable, as La Fonera's NIC is auto-sensing'').+*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'').
*c) 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'''. *c) 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'''.
-** Open a Command Prompt or terminal window and type in the following:+** Open a command prompt or terminal window and type in the following:
<pre> <pre>
telnet 192.168.1.254 9000 telnet 192.168.1.254 9000
</pre> </pre>
-:Note the 9000 after the IP. This specifies port 9000, which is the port Redboot is listening on. ''+:Note the 9000 after the IP. This specifies port 9000, which is the port RedBoot is listening on.''
:If the RedBoot> prompt is not immediately visible, try pressing enter once you've connected. :If the RedBoot> prompt is not immediately visible, try pressing enter once you've connected.
-:[You can use a ip/port scan program like [http://www.angryziber.com/ipscan/ Angry IP Scanner], and as soon as it can ping to your LaFonera you can telnet to it for 10 seconds and you can also check if port 9000 is availaible]+:[You can use a IP/port scan program like [http://www.angryziber.com/ipscan/ Angry IP Scanner], and as soon as it can ping to your LaFonera you can Telnet to it for 10 seconds and you can also check if port 9000 is available]
-:[Sometimes you may have to use another telnet client such as [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty]. Windows' built-in telnet may fail to show the prompt after rebooting the LaFonera]''+:[Sometimes you may have to use another telnet client such as [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty]. Windows' built-in Telnet client may fail to show the prompt after rebooting the LaFonera]''
:If everything goes well you should have a "RedBoot>" prompt in telnet. :If everything goes well you should have a "RedBoot>" prompt in telnet.
Line 87: Line 87:
'''6.''' 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/ '''6.''' 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/
-'''7.''' Copy root.fs and vmlinux.bin.l7 to your tftp server directory.+'''7.''' Copy root.fs and vmlinux.bin.l7 to your TFTP server directory.
:No matter what you use for a TFTP server, RedBoot will try to fetch the files from the root directory, e.g., <tt>/root.fs</tt>. Make sure your TFTP server is configured to do this as some are not by default. :No matter what you use for a TFTP server, RedBoot will try to fetch the files from the root directory, e.g., <tt>/root.fs</tt>. Make sure your TFTP server is configured to do this as some are not by default.
-'''8.''' Configure RedBoot for local IP and tftp server enter in telnet.+'''8.''' Configure RedBoot for local IP address and TFTP server in telnet.
<pre> <pre>
ip_address -l [local ip address/24] -h [remote server address] ip_address -l [local ip address/24] -h [remote server address]
Line 99: Line 99:
ip_address -l 192.168.1.254/24 -h 192.168.1.166 ip_address -l 192.168.1.254/24 -h 192.168.1.166
</pre> </pre>
-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 entered IP address.+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 entered IP address.
'''9.''' Run these commands in telnet. '''9.''' Run these commands in telnet.
Line 149: Line 149:
</pre> </pre>
-That's it. Your LaFonera should reboot and start DD-WRT. It by default 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".+That's it. Your LaFonera should reboot and start DD-WRT. It by default 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".
=Resetting NVRAM= =Resetting NVRAM=
-If the configuration is corrupted/incorrect, try resetting of the NVRAM. Power up the unit, and wait about 2 minutes, then hold down the Reset button for several seconds. You must do this while the firmware is loaded, hence waiting for a minute or two after powering it up.+If the configuration is corrupted/incorrect, try resetting of the NVRAM. Power up the unit, and wait about 2 minutes, then hold down the reset button for several seconds. You must do this while the firmware is loaded, hence waiting for a minute or two after powering it up.
'''If that fails, try these steps:''' '''If that fails, try these steps:'''
Line 173: Line 173:
=Reflashing LaFonera original firmware= =Reflashing LaFonera original firmware=
# Download the firmware: # Download the firmware:
-#* Download and unzip a pre-converted Zip file:<br>7.1.1 version (Enable-SSH hole is OPEN in this version): [http://rapidshare.com/files/18083671/fonera_0.7.1.1_unpacked.zip.html Link]<br>7.1.2 versions (Enable-SSH hole has been patched in this version): [http://uselesshacks.com/files/fonera_0.7.1.2.zip Link]+#* Download and unzip a pre-converted zip file:<br>7.1.1 version (Enable-SSH hole is OPEN in this version): [http://rapidshare.com/files/18083671/fonera_0.7.1.1_unpacked.zip.html Link]<br>7.1.2 versions (Enable-SSH hole has been patched in this version): [http://uselesshacks.com/files/fonera_0.7.1.2.zip Link]
#* If you want the firmware directly from FON, download it here: [http://www.fon.com/ Fon.com] ([http://downloads.fon.com/firmware/current/fonera_0.7.1.3.fon Direct link]) then follow these steps to convert it to usable files: #* If you want the firmware directly from FON, download it here: [http://www.fon.com/ Fon.com] ([http://downloads.fon.com/firmware/current/fonera_0.7.1.3.fon Direct link]) then follow these steps to convert it to usable files:
-#*# Remove the first 520 Bytes of the downloaded file.+#*# Remove the first 520 bytes of the downloaded file.
#*#* On Linux, Mac OS X (or other *nixes): '''<tt>tail --bytes +520 fonera_0.7.1.3.fon > fonera_0.7.1.3.tar.gz</tt>''' #*#* On Linux, Mac OS X (or other *nixes): '''<tt>tail --bytes +520 fonera_0.7.1.3.fon > fonera_0.7.1.3.tar.gz</tt>'''
-#*#* Windows: Use the mirrored ZIPs which are already converted.+#*#* Windows: Use the mirrored zip files which are already converted.
#*# Change the extension of the resulting file to <tt>.tar.gz</tt> and <tt>untar</tt> it. #*# Change the extension of the resulting file to <tt>.tar.gz</tt> and <tt>untar</tt> it.
-# You need 2 files from the steps above, <tt>kernel.lzma</tt> and <tt>rootfs.squashfs</tt>. Put these in your tftp-server root directory. If you don't have a tftp server, go back the beginning of this document and set one up.+# You need 2 files from the steps above, <tt>kernel.lzma</tt> and <tt>rootfs.squashfs</tt>. Put these in your TFTP server root directory. If you don't have a TFTP server, go back the beginning of this document and set one up.
-# Connect to the Redboot prompt and type in the following commands:+# Connect to the RedBoot prompt and type in the following commands:
<pre> <pre>
ip_address -l 192.168.1.254/24 -h 192.168.1.2 ip_address -l 192.168.1.254/24 -h 192.168.1.2
Line 197: Line 197:
If you've managed to get partway through this guild and find the LaFonera doesn't seem to respond anymore, here are a few recovery tricks. If you've managed to get partway through this guild and find the LaFonera doesn't seem to respond anymore, here are a few recovery tricks.
-# Set your computer's network card IP to 169.254.255.2 and the Subnet mask to 255.255.0.0. You may need to disconnect/disable all other network cards on that PC to ensure the proper route is used.+# Set your computer's network card IP address to 169.254.255.2 and the subnet mask to 255.255.0.0. You may need to disconnect/disable all other network cards on that PC to ensure the proper route is used.
# Connect your LaFonera to the network card via a network cable. # Connect your LaFonera to the network card via a network cable.
# In a browser, try to connect to http://169.254.255.1:8080 # In a browser, try to connect to http://169.254.255.1:8080
# If that fails, try to establish an SSH connection to <tt>169.254.255.1</tt> # If that fails, try to establish an SSH connection to <tt>169.254.255.1</tt>
-# If that fails, try to establish a TELNET connection to <tt>169.254.255.1</tt> on the standard port (23), or port 9000.+# If that fails, try to establish a Telnet connection to <tt>169.254.255.1</tt> on the standard port (23), or port 9000.
-#* Power on the LaFonera, and after 2 to 4 seconds, try to start the TELNET connection to catch the REDBOOT prompt.+#* Power on the LaFonera, and after 2 to 4 seconds, try to start the Telnet connection to catch the RedBoot prompt.
-#* When Using Redboot, mak sure you are using Line mode for telnet. In Mac OS X and Linux, enable this by creating a file named ".telnetrc" in your home folder. Have the following lines:+#* When Using RedBoot, make sure you are using line mode for Telnet. In Mac OS X and Linux, enable this by creating a file named ".telnetrc" in your home folder. Add the following lines:
<pre>192.168.1.254 <pre>192.168.1.254
mode line</pre> mode line</pre>
Line 210: Line 210:
'''1.''' Change your: '''1.''' Change your:
- Ipadress to: 192.168.1.166+ IP adress to: 192.168.1.166
Subnet mask to: 255.255.255.0 Subnet mask to: 255.255.255.0
Standard gateway to: 169.254.255.1 Standard gateway to: 169.254.255.1
Line 222: Line 222:
'''3.''' DON'T press "Open"! '''3.''' DON'T press "Open"!
-'''4.''' Power on your FON+'''4.''' Power on your LaFonera
-'''5.''' When your computer gets an ipadress press the "Open" button in Putty+'''5.''' When your computer gets an IP adress press the "Open" button in Putty
'''6.''' Hopefully you will see someting like this now: '''6.''' Hopefully you will see someting like this now:
Line 232: Line 232:
RedBoot></pre> RedBoot></pre>
-'''7.''' If Putty timeout or can't connect to your Fon try to restart the Fon and try to catch the RedBoot promt (you only have some seconds to do that!)+'''7.''' If Putty timeout or can't connect to your LaFonera try to restart the LaFonera and try to catch the RedBoot prompt (you only have a few seconds to do that!)
If that fails, you may have to resort to a serial connection If that fails, you may have to resort to a serial connection

Revision as of 12:40, 26 May 2007

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

Contents

Preparation

You'll need the following for this tutorial:

  1. SSH client
    • For windows, Putty is a free and popular choice
    • For Mac OS X, SSH is built in. Open Terminal.app and use "ssh".
  2. Telnet client
    • For Windows, Putty again will work.
    • For Mac OS X, telnet is built in. Open Terminal.app and use "telnet".
  3. The files root.fs and vmlinux.bin.l7 from a recent build directory located here, http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma and http://fonera.info/camicia/out.hex
  4. A method to serve the above files to the LaFonera.
    • Windows: Run HTTP file server on your Windows machine (it's a simple no-installer-needed HTTP server)
    • Mac OS X: Start up "Personal Web Sharing" in the "Sharing" pane of System Preferences. Use the "Sites" folder in your home directory to serve files.
    • Linux: Install Apache from your distribution's package manager. You might want to have a look at webfs as well. [Simple alternatives welcome]
    • You can provide Internet access to the LaFonera unit, but these three are preferred alternatives, as the LaFonera may try to auto-update it's firmware.
    • Internet access or a webserver is not necessary as long as you can copy the files locally with scp to the /tmp of the LaFonera and execute your commands afterwards.
  5. TFTP server software. (TFTP is not FTP; these are different protocols. TFTP, unlike FTP, is used primarily for transferring files to and from network equipment (e.g. your router, switch, hub, whatnot firmware upgrade or backup, or configuration backup and restore))
    • Simple TFTP server for Windows: http://sourceforge.net/projects/tftp-server/ or http://kin.klever.net/pumpkin/ or http://www.jounin.net/tftpd32.html
    • If you're running Linux, here's the simplest cross-distribution way to setup a TFTP server:
      1. Build tftp-hpa by running ./configure and then make.
      2. Become root (or use sudo) and run ./tftpd/tftpd -s -l [tftpdir] where [tftpdir] is your tftp server directory.
      3. 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:
      1. Create the TFTP server root by typing sudo mkdir /private/tftpboot
      2. Start the server by typing sudo /sbin/service tftp start
      3. Test it by typing tftp localhost then get (filename) where (filename) is the name of a file you have put in /private/tftpboot
      4. Note: the above instructions only seem to work on older OS X installations. If you're having trouble with the built-in TFTP on the command line, you can use this very useful freeware to manage it with a GUI: http://www.macupdate.com/info.php/id/11116
  6. Most information states that the FON's ethernet port is auto-sensing, therefore you are able to use the cable provided (or any cable for that matter). Please Confirm. You may need a crossover network cable or two normal cables and a hub/switch/router to connect your PC to the LaFonera for step 5 and beyond. 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 the cables and hub/switch.

Flashing

If you have a serial connection skip to step 6

1. Start with a stock LaFonera, with the original firmware (7.x). If you're unsure 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

  • For a LaFonera with firmware 0.7.1-1 or before: over wireless or over Ethernet (easier)
  • For a LaFonera with firmware 0.7.1-2 use: http://stefans.datenbruch.de/lafonera/#kolofonium)
    • Easier deployment of the Kolofinum hack: Change the name server (DNS) of your La Fonera to 88.198.165.155 and reboot. 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. No need to download HTML hacks and manual editing of files any longer.
    • EVEN EASIER!!! ****** This works on the newest firmware that has been hard-coded on the new chips'
      • Hold reset button for 30 seconds
      • Remove the power connector while still holding reset.
      • Replace power connector and continue holding reset button until "wifi" lights up and goes away again (a good 2-3 minutes of holding it).
      • Let go and wait for "wifi" to come back (2-3 minutes).
      • Now you may use the "step1.html" and "step2.html" method to turn SSH on as you would with the normal "r1" LaFonera. It will still continue to say "r2" on the LaFonera status page whilst you enjoy your SSH connection.

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 mislead by the name of the file. This is actually a FON kernel hacked to write on the mtd partion with RedBoot. After this step the LaFonera should be able to restart without any problem. 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.
  • 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).
  • c) 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.
    • Open a command prompt or terminal window and type in the following:
telnet 192.168.1.254 9000
Note the 9000 after the IP. This specifies port 9000, which is the port RedBoot is listening on.
If the RedBoot> prompt is not immediately visible, try pressing enter once you've connected.
[You can use a IP/port scan program like Angry IP Scanner, and as soon as it can ping to your LaFonera you can Telnet to it for 10 seconds and you can also check if port 9000 is available]
[Sometimes you may have to use another telnet client such as Putty. Windows' built-in Telnet client may fail to show the prompt after rebooting the LaFonera]
If everything goes well you should have a "RedBoot>" prompt in telnet.

6. 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/

7. Copy root.fs and vmlinux.bin.l7 to your TFTP server directory.

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.

8. Configure RedBoot for local IP address and TFTP server 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.166 in this case.
ip_address -l 192.168.1.254/24 -h 192.168.1.166

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 entered IP address.

9. Run these commands in telnet. 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! 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.
  • a) This is a sample of the output you will see.
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa83e0000-0xa83f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa83e0000: .

load -r -v -b 0x80041000 root.fs
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x802e3fff, assumed entry at 0x80041000
RedBoot> fis create -b 0x80041000 -f 0xA8030000 -l 0x002C0000 -e 0x00000000 rootfs
... Erase from 0xa8030000-0xa82f0000: ............................................
... Program from 0x80041000-0x80301000 at 0xa8030000: ............................................
... Erase from 0xa83e0000-0xa83f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa83e0000: .

RedBoot> load -r -v -b 0x80041000 vmlinux.bin.l7
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x80120fff, assumed entry at 0x80041000

RedBoot> fis create -r 0x80041000 -e 0x80041000 -l 0x000E0000 vmlinux.bin.l7
... Erase from 0xa82f0000-0xa83d0000: ..............
... Program from 0x80041000-0x80121000 at 0xa82f0000: ..............
... Erase from 0xa83e0000-0xa83f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa83e0000: .

RedBoot> fis create -f 0xA83D0000 -l 0x00010000 -n nvram
... Erase from 0xa83e0000-0xa83f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa83e0000: .
  • b) Run this command in telnet to reboot.
reset

That's it. Your LaFonera should reboot and start DD-WRT. It by default 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".

Resetting NVRAM

If the configuration is corrupted/incorrect, try resetting of the NVRAM. Power up the unit, and wait about 2 minutes, then hold down the reset button for several seconds. You must do this while the firmware is loaded, hence waiting for a minute or two after powering it up.

If that fails, try these steps:

1. Reset the LaFonera and telnet into the Redboot prompt (see Step 5 above).

2. Enter the following command to erase the NVRAM partition.

fis erase -f 0xA83D0000 -l 0x00010000

3. Load DD-WRT by typing and executing these commands:

fis load -l vmlinux.bin.l7
exec

You're all done. DD-WRT will rebuild the NVRAM and it will be fresh as spring!

Reflashing LaFonera original firmware

  1. Download the firmware:
    • Download and unzip a pre-converted zip file:
      7.1.1 version (Enable-SSH hole is OPEN in this version): Link
      7.1.2 versions (Enable-SSH hole has been patched in this version): Link
    • If you want the firmware directly from FON, download it here: Fon.com (Direct link) then follow these steps to convert it to usable files:
      1. Remove the first 520 bytes of the downloaded file.
        • On Linux, Mac OS X (or other *nixes): tail --bytes +520 fonera_0.7.1.3.fon > fonera_0.7.1.3.tar.gz
        • Windows: Use the mirrored zip files which are already converted.
      2. Change the extension of the resulting file to .tar.gz and untar it.
  2. You need 2 files from the steps above, kernel.lzma and rootfs.squashfs. Put these in your TFTP server root directory. If you don't have a TFTP server, go back the beginning of this document and set one up.
  3. Connect to the RedBoot prompt and type in the following commands:
ip_address -l 192.168.1.254/24 -h 192.168.1.2
fis init
load -r -v -b 0x80040450 rootfs.squashfs
fis create -b 0x80040450 -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs
load -r -b %{FREEMEMLO} kernel.lzma
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
fis load -l vmlinux.bin.l7
exec

Reboot the FON and you're done.

Recovery of a non-responsive LaFonera

If you've managed to get partway through this guild and find the LaFonera doesn't seem to respond anymore, here are a few recovery tricks.

  1. Set your computer's network card IP address to 169.254.255.2 and the subnet mask to 255.255.0.0. You may need to disconnect/disable all other network cards on that PC to ensure the proper route is used.
  2. Connect your LaFonera to the network card via a network cable.
  3. In a browser, try to connect to http://169.254.255.1:8080
  4. If that fails, try to establish an SSH connection to 169.254.255.1
  5. If that fails, try to establish a Telnet connection to 169.254.255.1 on the standard port (23), or port 9000.
    • Power on the LaFonera, and after 2 to 4 seconds, try to start the Telnet connection to catch the RedBoot prompt.
    • When Using RedBoot, make sure you are using line mode for Telnet. In Mac OS X and Linux, enable this by creating a file named ".telnetrc" in your home folder. Add the following lines:
192.168.1.254
	mode line

If all steps above fails you can try this:

1. Change your:

IP adress to: 192.168.1.166
Subnet mask to: 255.255.255.0
Standard gateway to: 169.254.255.1
DNS: 169.254.255.1 (maybe is an optional setting)

2. Open Putty and enter:

Host name: 192.168.1.254
Protocol: Telnet 
Port 9000

3. DON'T press "Open"!

4. Power on your LaFonera

5. When your computer gets an IP adress press the "Open" button in Putty

6. Hopefully you will see someting like this now:

== Executing boot script in 9.160 seconds - enter ^C to abort
 ^C
 RedBoot>

7. If Putty timeout or can't connect to your LaFonera try to restart the LaFonera and try to catch the RedBoot prompt (you only have a few seconds to do that!)

If that fails, you may have to resort to a serial connection

Serial connect devices are listed in the #External_links section of this guide.

See also LaFonera_Software_Debricking.

External Links

References