aughust 2012
This is mostly straight from the OpenWRT site. I'm using the WRT54G v 2.2 mentioned in The LinkSys WRT54G revisited.
I needed to debrick because the installation of OpenWRT failed. That's the reason I'm TFTP'ing an OpenWRT image, as opposed to the latest official firmware.
Just power it off.
Put an ethernet cable between the PC and one of the LAN ports of the WRT54G, and give the NIC on the PC an IP:
apprentice@host:~$ ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up
The DD-WRT Wiki tells how to interpret the LED blinking at powerup. I adjusted one of the scripts at that page, after reading WRT54 Tips:
while ! ping -W1 -c1 -q 192.168.1.1 -q >/dev/null 2>&1 ; do sleep .1 ; echo -n . ; done cat <<EOF|tftp 192.168.1.1
bin
put openwrt-wrt54g-squashfs.bin
EOF
ping 192.168.1.1
The image can be fetched from the OpenWRT fileserver.
Directing a browser to 192.168.1.1 shows that the upload somehow did succeed.
From the PC, log onto the WRT54G using telnet, and set the root password.
Following the WRT54G-specific installation HOWTO, say:
nvram set boot_wait=on
nvram set boot_time=10
nvram commit && reboot
Upload openwrt-brcm47xx-squashfs.trx, and, till following the Wiki, do
root@OpenW:~# sysupgrade /tmp/openwrt-brcm47xx-squashfs.trx
Configure DropBear to listen on the WAN port, and make it use keys for root (in /etc/dropbear/authorized_keys
), not passwords:
root@OpenWrt:~# sed -i "/RootPasswordAuth/ s/'on'/'off'/" /etc/config/dropbear
(We'll restart dropbear later.)
root@OpenWrt:~# mv /etc/config/wireless /etc/config/wireless.dist
root@OpenWrt:~# wifi detect>/etc/config/wireless
root@OpenWrt:~# sed -i 's/option disabled 1/option disabled 0/' /etc/config/wifi
root@OpenWrt:~# /etc/init.d/network restart
To be documented next time I have time...