As I had been gifted a nice WRT54G (v3.1, so nice for tinkering), I wanted to toy around with it. Unfortunately I did not have the right username and password combination to access the webinterface. My solution: trying to reflash or reset the device.
The Linksys router had already been fitted with a previous OpenWrt install, so the resetbutton does not work as expected. Or actually, once you are aware of the change OpenWrt applies, it’s totally expected, but it did take me a couple of tries before finding out it’s not used to reset firmware settings anymore, but to boot in failsafe mode instead.
So that didn’t work. Then, on to flash it with a brand new install. Even though many step-by-step guides on doing this seem to be online, I couldn’t quite get it to work as smoothly as expected. So here’s my own little guide to add to the mix
Before starting, make sure that while you still have a working connection to the internet, you have already downloaded the latest OpenWrt firmware. Make sure you pick the right bin-file for your specific router. Also, you may not have Advanced TFTP (atftp) installed yet, so make sure you take care of that as well:
emerge -av atftp
After making all the preparations, you’ll first want to shut down any networkmanager you may have running at the moment in KDE or Gnome. That also includes managers such as Wicd (which I have grown quite fond of lately).
Second, switch off the Linksys WRT54G by cutting it’s power. Leave a standard ethernetcable between your router and the machine you are working on. You may want to disconnect any other machines connected to the router for clarity.
Third, open two terminals, so you can view both at the same time. Make sure you enter into superuser mode in both terminals.
Fourth, in one of the terminals, enter the following to lock your eth0 (change if needed) interface settings:
ifconfig eth0:1 192.168.1.5 netmask 255.255.255.0
Fifth, in the first terminal enter the following:
ping -f 192.168.1.1
And press enter. Dots will run across the terminal.
Sixth, in the second terminal, cd to the directory you downloaded the bin-file to and enter the following command:
atftp --trace --option "timeout 1" --option "mode octet" --put --local-file openwrt-xxx-x.x-xxx.bin 192.168.1.1
Change openwrt-xxx-x.x-xxx.bin to the name of your firmware bin-file, do NOT hit enter, but do keep this terminal in focus.
Now, plug back the powercord to boot the Linksys WRT54G. As soon as the dots in the first terminal stop running, hit enter in the second terminal. If you responded timely, a lot of information on progressing uploads will float by and your router should reboot itself.
Once this is done, you’ll have to wait for it to be fully rebooted after which you can restart your networkmanager of choice, be assigned an ip-adress by dhcp and navigate towards the webinterface by entering http://192.168.1.1 in your browser of choice. From here it’s pretty much self-explanatory.
If I discover any other tricks, happen to start experimenting with my Neo FreeRunner again or feel that anything else needs to be added to or shared with the internet, I’ll post again. For now, I need to study
(Note: large part of this post is an adaptation of the OpenWRT wiki on using TFTP)
Tags: atftp, firmware, flash, Gentoo Linux, guide, lost password, OpenWrt, reset, router, wireless, WRT54G

