I have acquired a collection of Linksys WRT54GL routers to use as wireless bridges – with only one seemingly small task to do – reflash them with a firmware of my choice. Easy, I thought!
It turns out that the routers had a custom firmware on, that even after a 30/30/30 reset, they didn’t allow the facility to flash the firmware through the UI.
Most interaction had to be done through the command line – here is the procedure I followed:
- 1. Perform 30/30/30 reset as described here.
- When the router is booting up after only a second or two, repeatedly press the Cisco Systems button on the front – for several seconds. This will enable Failsafe mode.
- Telnet into the router (after having manually set your IP address to 192.168.1.2. (If this doesn’t work you probably aren’t in Failsafe mode).
- Run “firstboot”.
- Reset the root password with “passwd”.
- Reboot “reboot -f”.
- When the router reboots, you can connect with ssh with the root user, and the password specified previously. From here you can transfer the bin file and flash (as described here or below).
- Use scp to transfer the bin file to the temp file system. “scp ~/Downloads/dd-wrt.v24_mini_generic.bin email@example.com:/tmp/”.
- Log in to router with ssh, and change into the /tmp/ directory.
- Rename the file, to make it a trx. “mv dd-wrt.v24_mini_generic.bin dd-wrt.v24_mini_generic.trx”.
- Write to linux fs and reboot “mtd write dd-wrt.v24_mini_generic.trx linux && reboot”.
- The router will now boot back up in dd-wrt. Yay!