Unbricking Your Linksys WRT54G Router

The other day I realized that the dd-wrt custom firmware I was running on my Linksys WRT54G version 3 router was out of date and susceptible to a serious security vulnerability (see here: http://milw0rm.com/exploits/9209). So like a good system administrator, I immediately proceeded to upgrade to the latest version.

While this should have been a simple process, the router spit back a “firmware upgrade failed” message. Next thing I know, the web interface is gone and the lights are flashing on the front. One of the good signs was that it still recognized when I plugged something into one of the LAN ports and it was returning TTL=100 when pinged. This was a very good sign since it meant that the router was not completely bricked and was still recoverable. The TTL=100 means that the firmware loader is working, but it is waiting for firmware. Excellent!

So now it was time to attempt to recover it. I went to the Linksys site and downloaded the latest firmware for my router. I then loaded a program called TFTP. You can get a copy of that here. Next I changed my network adapter to assign itself a static IP address of 192.168.1.100 (if you don’t do this, you won’t be able to interact with the router). Open the TFTP program and set “server” to 192.168.1.1, leave password blank, select the Linksys firmware you just downloaded, and leave retries at 3. Now I was ready to feed the router some firmware.

Timing is everything with this. The easiest way I found is to watch the light on my network adapter card. In order to upload the firmware, you must unplug the power from your router (leave the network cable running from your computer to the router plugged in of course). Now, while keeping an eye on the light on your network adapter, plug in the router. As soon as the network adapter’s light comes on, hit the “Upgrade” button in the TFTP program. You should receive a “successfully installed firmware” message. If not, try again. Remember that you must send the router the firmware at a very specific time for it to work.

Now that you have the default Linksys firmware working (and you’ve waited for the power light on the front to stop flashing), you can leave it as is or attempt to upgrade to new firmware. After having the trouble with dd-wrt, I decided that it was time to switch to something different. I chose to switch to Tomato. I am very happy with Tomato! Everything runs faster and better with it. Not to mention it manages connections much more efficiently.

RHEL5/CentOS 5 Firewire 1394 Support

Today I plugged in my external hard drive and expected it to “just work” like it had in Ubuntu. Instead of recognizing and mounting the hard drive, the OS automagically ignored it. The first thing that I checked was that I had enabled support for Firewire in the bios. It was enabled just like it should be, so I then checked the hard drive using my laptop. The hard drive worked perfectly on the laptop so I decided that CentOS was the problem.

I’ve found that the documentation for CentOS is VERY lacking. It’s hard to find answers for some of the basic questions new users typically have. That fine and dandy, but it also means that one will have the face some of the more advanced problems all alone. However, after a good bit of searching, I finally found the solution to enabling Firewire in CentOS 5 buried on someone’s blog. I’m going to keep a copy here just in case I need to use it again and in the hope it will make someone’s search much easier. This is a summarized version of Joe’s fix:

Step 1) Comment out the following line in /etc/modprobe.d/blacklist-firewire

blacklist firewire-ohci

Step 2) Create or update the file /etc/hal/fdi/policy/preferences.fdi with this code:

<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
 <match key="@info.parent:@info.parent:@info.parent:info.linux.driver" string="firewire_ohci">
   <match key="info.category" string="storage">
     <match key="storage.drive_type" string="disk">
       <merge key="storage.hotpluggable" type="bool">true</merge>
     </match>
   </match>
 </match>
</device>
</deviceinfo>

After doing this, your Firewire device should be recognized and work relatively well. 🙂