[HOWTO] Update firmware on Linksys router

kilowatt

mach-o mach-o man
This may seem obvious to some people, but I imagine to others it is not.


Synopsis:
Linksys only provides a method of updating router firmware for windows clients. Using the built-in unix command tftp, it is simple to update router firmware from any unix system, including Mac OS X.

Directions:
1) Download new router firmware to your macintosh. See linksys.com for this. When you are in the Support area, click 'Downloads', select your model (its written under the router usually), and navigate to the windows firmware .zip download.

The windows download expands into a tftp client (tftp.exe), a few readme files, and a firmware update - code.bin.

code.bin is all we need here. This is compiled code for whatever platform the linksys is built on. You can check it out using the strings command in the terminal.

2) Unzip the file using either the unix unzip command, or Stuffit Expander. Safari will automatically unzip the file with Stuffit Expander.

3) Open up the Terminal, and navigate to the location where code.bin is.

An easy way to do this, is to navigate to this file in the finder, switch to the terminal and type "cd " (no quotes, and make sure you place a space after the 'cd' part), and now, just drag the folder onto the terminal window. Then, in the terminal, press enter.

Presto, you're in the folder.

4) Before we can go any farther, here's a little information about tftp:

tftp, the Trivial File Transfer Protocol is typically used with automated downloads, such as those required by diskless devices which require files off servers when they boot up.

tftp is designed not to require passwords, and it does not allow for the contents of a directory to be viewed. In other words, you have to know the file you want.

Linksys has changed things a bit on us here. I don't know how, but they have added a password requirement to tftp.

Here is how you get around this:

5) Open up a browser window to your router's home page. This is usually http://192.168.1.1/. Log in (default password is 'admin', and the username may be anything), and press "Password" on the first page.

Delete all the characters in the Password: fields. Press "Apply".

Don't worry, we'll change it back to something when we finish. As a precaution, you can disable remote admin ahead of time (mine is disabled all the time).

6) Back in the terminal, we are going to use the tftp command to place code.bin on the router. Here is how I did this - rather than telling you step by step how, just follow my example (I'm doing it right now, so this should be fairly accurate).

Code:
$ /usr/bin/tftp
tftp> connect 192.168.1.1
tftp> bin
tftp> verbose
Verbose mode on.
tftp> put code.bin
putting code.bin to 192.168.1.1:code.bin [octet]
Sent 232124 bytes in 24.4 seconds [76106 bits/sec]
tftp> quit
$

Pretty simple, isn't it?

if tftp bitches about your password being wrong, make sure you pressed 'apply' on the linksys setup page, and make sure you entered binary transfer mode (the 'bin' command).

7) Put your password back to something creative at http://192.168.1.1/Passwd.htm.

For extra credit, check and see if your firmware really did get upgraded - look at the setup page and see what the Firmware Version:__reads.

PS: Does anyone know how to pass a password with the unix tftp program?
 
I have tried this technique over and over and over and it has never worked for me with my 4-port BEFSR41. Dunno what the problem is, but it always just times out and never sends anything via tftp. I have also tried using the Mac OS X tftp GUI client and it never completes either. The only way I have ever gotten it to work is with the old OS 9 tftp GUI client
 
The problem i have with the terminal method is that it seems impossible to set the password blank in the browser. Even after deleting the chars several times, teh password always seems to have something in it and the tftp client refuses to connect.
 
well, the password is always printed as "••••••••••••" on the router's page, even if you reset it. This is just so you can't view the page's html and figure out the password (used to work).

If you do set it blank, MAKE SURE you type 'bin' first. Without bin, it will give you a password error, every time.

Also, make sure you are typing the correct ip address into the tftp client.
 
I did some googleing, and it looks like you can also get errors if your firmware is not titled code.bin

So, rename it to code.bin if it isn't named that already.

Also, it appears people have had trouble reseting the passwords using mozilla-based browsers, such as netscape. I was able to do this fine in Safari.
 
How do you select the file you want to put in the router? What do you write after you write "put"? It didn't work for me. It says no such file or directory. I already did the CD.
 
This is a really old thread and its instructions probably are no longer relevant since newer Linksys routers have a firmware update mechanism in their web based GUI.

What model router do you have?
 
I have tried to install the firmware using safari. Failed. I am now trying to install it with terminal, but don't know what to put into the fields, since it tells me the file or directory doesn't exist.

My router is a WRT54G Ver.6. I am using a Mac with Snow Leopard.
 
Back
Top