10.11.2005 13:50

OpenWrt on Asus wl-500g - quickguide

This guide for OpenWrt applies only to asus wl-500g. It is NOT tested on wl-500g deluxe or wl-500b.

OpenWrt was mainly designed for Linksys wrt54g, but there are versions for Asus wl-XYZ[b|g] too.  Details you can find on OpenWrt pages.

  1. Get openwrt for brcm (broadcom) http://downloads.openwrt.org/whiterussian/rc3/bin/openwrt-brcm-2.4-jffs2-4MB.trx.
  2. Power on asus and go through its functions in original FW on either trought wifi or eth (they are all bridged together). Asus gives you IP trought dhcp. This is last time you see this FW (You can reflash it later back, if you do not like openwrt), so check your asus is working correctly, before voiding warranty.
  3. There are several ways how to flash openwrt. You can use tftp or windows recovery utility or go trough web page fw update. Recommended are tftp and win util. For both you need to be connected by wired eth. I did that trought win util.
  4. Install utils from asus CD (utilities/English/setup.exe). Find recovery tool in menu and start it. Browse to FW file you downloaded.
  5. Set your PC IP to fixed address e.g. netmask otherwise you'll be not able to flash and you get message "Invalid IP" in step 7.
  6. Unplug power from asus.
  7. Click upload.
  8. Press restore/reset on asus (small black button at the back) and plug in the power. (You need three hands.:)
  9. Release restore/reset on asus.
  10.  FW upload should start. Otherwise tools says "No ap in recovery mode found" (Message varies with tool version.).
  11.  Wait 5minutes (lot of things happen on first boot (e.g. sshkeygen)).
  12. Unplug and plug back power.
  13. Telnet
  14. Set password with passwd => telnet is disabled, now only ssh works.

There are two ways how to configure asus with openwrt. Either trought NVRAM, which is prefered, or linux way in your own init.d script. Here is my setup script:


ifconfig br0 down
brctl delbr br0

ifconfig eth2 netmask
ifconfig eth2 up
route add default gw

iwconfig eth2 mode managed
#sleep 1
iwconfig eth2 essid sektor-sz.CZFree.Net

# 4 port LAN with dhcp
ifconfig eth0 netmask
ifconfig eth0 up

# iface for fb - own segment + 192.168 access
ifconfig eth1 netmask
ifconfig eth1:1 netmask

# flush iptables - there are some default options in openwrt I do not want
iptables -P INPUT ACCEPT
iptables -F
iptables -t nat -F

# nat rules
iptables -t nat -A POSTROUTING -s -o eth2 -j MASQUERADE

# do not run udhcpc otherwise ap will be unaccesable when it does not get dhcp response
#udhcpc -i eth2

Email comment