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 http://192.168.1.1 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. 192.168.1.3 netmask 255.255.255.0 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 192.168.1.1
  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:

#!/bin/sh

ifconfig br0 down
brctl delbr br0

ifconfig eth2 10.18.2.200 netmask 255.255.255.192
ifconfig eth2 up
route add default gw 10.18.2.193

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

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

# iface for fb - own segment + 192.168 access
ifconfig eth1 10.1.6.1 netmask 255.255.255.248
ifconfig eth1:1 192.168.1.1 netmask 255.255.255.0


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

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

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


Email comment