Jimmy's weblog


Linksys WRT54G and OpenWRT

Filed under: — jimmy @ 9:23 pm

Today it was time to install openwrt on my wlan router. There’s enough of good documentation there, nevertheless I will describe the most important steps here for my router (WRT54G V2, running firmware 4.20.7).

You first need to know how to access the router. You might have heard of the ping hack. Well, depending on your hardware and firmware revisions there are different tricks to exploit it. I used a modified html file for that purpose, which I found in the openwrt wiki.
There’s a line which defines the command:

<input maxLength=128 name=ping_times size=128 value="'/sbin/ifconfig > /tmp/ping.log 2>&1'">

Simply replace the command and its output will be displayed in the box. This works only if your router has the ip address You could change it but if you want to upload the firmware later you have to configure you computer to be in the 192.168.1.x subnet. During boot the router always has the ip address!
According to all documentation I’ve read the WAN port must be setup, which means it must have an ip address.

I then enabled boot_wait by executing the commands:

`/usr/sbin/nvram set boot_wait=on`
`/usr/sbin/nvram commit`
`/usr/sbin/nvram show > /tmp/ping.log`

I was lazy, so I downloaded the binary firmware white russian rc3.
Next step: Get a tftp client and upload the firmware:

reptile:~$ apt-get install atftp
jimmy@reptile:~$ atftp
tftp> mode       
Current mode is octet.
tftp> timeout 2
tftp> trace
Trace mode on.
tftp> put openwrt-wrt54g-squashfs.bin

After hitting enter you have to immediately plug in your router again.

Finally: telnet to the router and read Using OpenWrt for the first time

Leave a Reply