Based on http://wiki.openwrt.org/OpenWrtDocs/Hardware/Asus/WL500GP and http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration/WiFiEncryption – all credits goes to openwrt wiki
Might be outdated by now.

Use at your own risk!

Prepare

  1. Make a backup of the system, like described in the link abov.
  2. Remove the power cord
  3. Connect computer to the routers lan1 port
  4. Press and hold the reset button in
  5. Reinsert power cord, and release reset button when the power LED is flashing slowly
  6. Do sudo dhclient eth0 to connect to the router

Install firmware

  1. Download openwrt-brcm-2.4-squashfs.trx from http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/
  2. nstal atftp, tftp or tftp-hpa (in ubuntu do sudo apt-get install tftp for example)
  3. tftp 192.168.1.1
  4. tftp > binary
  5. tftp > trace
  6. tftp > put openwrt-brcm-2.4-squashfs.trx
  7. Wait for at least six minutes! When time is up you can restart the router by taking out the power cord and inserting it again – if you do anything before you risk do brick the router!!!!

Setup

Telnet to the router and change the password

telnet 192.168.1.1
root@OpenWrt:/# passwd
Changing password for root
New password:
Retype password:
Password for root changed by root

Now you are able to ssh to the router

Enable wifi

(Note this i for Breadcom, if you have Atheros see the link at the top. If you write dmesg in router terminal you should be able to the which driver you are)

uci set wireless.wl0.disabled=0
uci commit wireless && wifi

Wifi encryption

Note: this is also based on Broadcom hardware. This only enables WPA2, see http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration/WiFiEncryption for types and Atheros

  1. opkg install nas (might be installed by default)
  2. uci set wireless.cfg2.encryption=psk2
  3. uci set wireless.cfg2.key=<password>
  4. uci commit wireless && wifi

Note password shoud be between 8 and 63 characters and only contain letters and digits

USB

source: http://forum.openwrt.org/viewtopic.php?pid=65789 and http://wiki.openwrt.org/UsbStorageHowto

  1. ipkg update
  2. ipkg install kmod-usb-uhci-iv
  3. ipkg install kmod-usb2
  4. insmod ehci-hcd
  5. The following might not be necessary, but if you have problems mounting they could help
  6. ipkg install kmod-fs-vfat
  7. ipkg install kmod-nls-cp437
  8. ipkg install kmod-nls-cp850
  9. ipkg install kmod-nls-iso8859-1
  10. ipkg install kmod-nls-iso8859-15
  11. ipkg install kmod-nls-utf8

Enable SSH from the outside

(http://forum.openwrt.org/viewtopic.php?id=12545 )

To enable SSH from the outside you need to do uncomment the two lines  starting with iptables below “### Open port to WAN”, in /etc/firewall.user. My firewall.user file looks like this:

[...]
### Open port to WAN
## -- This allows port 22 to be answered by (dropbear on) the router
iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT
iptables        -A input_wan      -p tcp --dport 22 -j ACCEPT
[...]

When the /etc/firewall.user is updated you will need to do  /etc/init.d/firewall restart or a reboot to make the changes take effect.
You may also need to forward the port from your internet modem/router.

Upgrade

  1. wget the newest version to /tmp
  2. mtd write openwrt-brcm-2.4-squashfs.trx linux && reboot
  3. Setup the rest of the system (security etc.)

Or alternatively use the sysupgrade, which backups config files before applying the trx, very useful.

Tools

See all connected hosts

root@OpenWrt:~# arp
IP address       HW type     Flags       HW address            Mask     Device
87.57.16.1       0x1         0x2         00:AA:BB:CC:FF:EE     *        eth0.1
192.168.1.249    0x1         0x2         01:AA:BB:CC:FF:EE     *        br-lan
192.168.1.247    0x1         0x2         02:AA:BB:CC:FF:EE     *        br-lan

Recovery

If you, like me, happen to screew things up big time, there is some possibilities make things right again.

Failsafe mode

  1. Set your lan to use a IP between 192.168.1.2 and 192.168.1.254 (gateway and DNS does not matter)
  2. Unplug the power cord
  3. Plug the power cord back
  4. When power LED turns off press the reset or ezsetup button
  5. When the power LED starts blinking you can enter the router over telnet (no password or username)

Reset

This helped me out. First the JFFS2 partition is completely erased, removing all packages, and the change is committed

firstboot
sync

(from http://wiki.openwrt.org/OpenWrtDocs/Troubleshooting )