TFTP flash

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:34, 29 August 2008 (edit)
Soulstace (Talk | contribs)
m (Linksys TFTP GUI - this works with many other brands too.)
← Previous diff
Revision as of 16:37, 29 August 2008 (edit) (undo)
Soulstace (Talk | contribs)
m (Linksys TFTP GUI - redhawk's idea was better. don't use direct link)
Next diff →
Line 39: Line 39:
===Linksys TFTP GUI=== ===Linksys TFTP GUI===
-Linksys has a GUI flash utility which may be found at ftp://ftp.linksys.com/pub/network/tftp.exe and can set the number of retries. It works with many other brands of routers too, not just Linksys.+Linksys has a GUI flash utility which may be tftp.exe on ftp://ftp.linksys.com/pub/network and can set the number of retries. It works with many other brands of routers too, not just Linksys.
Here are the setup and use instructions for the TFTP utility. Here are the setup and use instructions for the TFTP utility.

Revision as of 16:37, 29 August 2008

Contents


General

This article describes how to do a initial flash or a TFTP recovery flash for your device.

  • make sure you have a tftp client installed (linux package, e.g. from sf.net or Windows GUI TFTP Utility)
  • connect your router via a switch or hub to your PC (extra switch/hub is optional)
  • make sure that you have a fixed IP address in the same network as router (example w/picture)
  • get the latest dd-wrt release here (plz use the mini version for devices with 4mb flash & the micro version for 2mb flash devices)

Windows

Command Line

  • ping the router permanently, by running in Start > Run:
 ping -t 192.168.x.x -w 10

and see if it is responding, e.g. like this

 64 bytes from 192.168.x.x: icmp_seq=1 ttl=64 time=2.90 ms
 64 bytes from 192.168.x.x: icmp_seq=2 ttl=64 time=0.264 ms
 64 bytes from 192.168.x.x: icmp_seq=3 ttl=64 time=1.44 ms
  • reboot the router via web-if or powercycle (the ping response will stop)
  • if you see the the first ping response again ...
 From 192.168.x.x icmp_seq=1 Destination Host Unreachable
 From 192.168.x.x icmp_seq=2 Destination Host Unreachable
 64 bytes from 192.168.x.x: icmp_seq=3 ttl=128 time=2.90 ms
 64 bytes from 192.168.x.x: icmp_seq=4 ttl=128 time=3.50 ms
 64 bytes from 192.168.x.x: icmp_seq=5 ttl=128 time=0.90 ms

... you will have to start the tftp upload in binary mode immediately. the ttl of the boot tftp server will be 100 or 128. this is the right time to flash (the ttl of ddwrt is only 64). if the upload doesn't work the first time, then you have to try the first steps again. you have to be very fast! ;-) maybe you will have to reset the device via reset button a few times to get the tftp-boot working (siemens, belkin and similar hw).

 tftp -i 192.168.x.x put dd-wrt.vXX_XXX.XXX
  • when the upload is successful wait a few minutes (be patient! dont reset the router! keep waiting!) and the router will start responding at 192.168.1.1 with dd-wrt (you might have to change your ip address first to be in the 192.168.1.x network ;-) )!
  • username: root / pw: admin
  • always do a hardware factory reset after the successful flashing!

Linksys TFTP GUI

Linksys has a GUI flash utility which may be tftp.exe on ftp://ftp.linksys.com/pub/network and can set the number of retries. It works with many other brands of routers too, not just Linksys.

Here are the setup and use instructions for the TFTP utility. An updated copy can be found here TFTP2

  1. Set your computer hardware adapter to a Static IP address within the same subnet as the router's original firmware (ex...set a static of 192.168.11.10 if your router's default IP is 192.168.11.1). Set the Mask to 255.255.255.0.
  2. Start the TFTP utility.
    • The Server/IP address is that of the router being flashed.
    • Leave the Password blank.
    • Navigate and select the firmware you wish to flash.
    • Set retries to 10.
  3. Now plug the Ethernet Cable from your computer into a LAN port of the router.
  4. Unplug the router....plug it back in...immediately hit the Upgrade button on the TFTP utility.
    • If the router does not flash immediately....stop the attempts and vary the timing from when you plug the unit in...to the time you hit the start button. I have had good luck flashing within the first 1/2 second of reapplying powering the device.
  5. Once it flashes and you receive the Success message....wait for a full 2 minutes while the new firmware flash configures itself...DO NOT depower the router!
  6. After the 2 minutes are up....do a Hard reset or 30/30/30 on the router...then configure at 192.168.1.1 (dd-wrt's default IP address). The default dd-wrt Username/Password is root/admin.

Linux and Mac OS X

OS X ships with a command-line TFTP client.
In Linux, tftp can generally be installed with whatever package manager your distribution uses.
on suse:

 smart install tftp

on fedora:

 yum install tftp

on ubuntu

 sudo apt-get install tftp

etc.
The tftp client for Linux and OS X is very similar. When invoked, it gives the user a prompt and takes commands from the standard input.
Binary mode can be set with command-line flags - in OS X, the "-e" flag sets binary mode (among other things which are less important), and in Linux "-m binary". Binary can be set from the prompt in either (this is done below for consistency).

Typical usage looks like:

 tftp 192.168.x.x
 > binary
 > put dd-wrt.vXX_XXX.XXX

Because the transfer must be initiated in a narrow time window during the router's bootup, tftp's retransmit option is useful. In the following sequence of commands, tftp will retry to send the file every second for one minute. This can be issued just before the router is booted, so that it will retry to send every second while the router boots.

 tftp 192.168.x.x
 > binary
 > rexmt 1
 > timeout 60
 > put dd-wrt.vXX_XXX.XXX

If it worked, it will say something like "Sent 1769472 bytes in 9.0 seconds"

If it didn't work, it will say "Transfer timed out." This is often because it cannot connect to the IP. Make sure you have manually set your computer's IP to one in the router's subnet.

You can quit tftp with the 'quit' command or hitting ctrl+D.

Related Links

Flash Your Siemens SE505

TFTP Flashing a Belkin F5D7230 - more detailed notes on flashing the F5D7230 (v1000, specifically)

Using Ubuntu and tftp to flash an Asus WL-500W