Running Debian on ASUS WL-500G deluxe

You can run Debian (mipsel port) on ASUS WL-500g Deluxe, ASUS WL-500g Premium, ASUS WL-700gE, Linksys WRTSL54GS (and probably on similar, mipsel-based routers). See also a separate page for running Debian on ASUS WL-500W.

ASUS WL-500g Deluxe is a small router with 200 MHz CPU, 32 MB RAM, 5 ethernet ports, wireless.

Its newer version, ASUS WL-500g Premium has a 266 MHz CPU. With these specs, they are easily capable to run a small web or mail server. Being totally silent (no fan, no hard disk) is a clear advantage.

There is also a model with a HDD, and 64 MB RAM - ASUS WL-700gE. It will run Debian as well, however, a custom OpenWrt build is required since it has only 2MB Flash, and a small userspace is required to partition and format the HDD before Debian is installed. It has also only been tested with a hand created Debian image created by debootstrap.

A nice thing about this is that you don't need to open your device (and connect via serial cable etc.), but also that you can run "pure" Debian (not in a chroot jail as suggested on some other pages).

Note that you will need an external storage, like a USB-stick or a USB hard disk.

Nice read, I just passed this onto a friend who was doing some research on that. And he just bought me lunch since I found it for him smile So let me rephrase that Thank you for lunch! Whenever you have an efficient government you have a dictatorship. by Harry S Truman. edgeccdedcaaggae


After you flash the kernel, write Debian to your USB device and configure the network, you can boot your ASUS to a fully-working Debian.

It doesn't matter which USB port you choose (unless you connect more devices).

You can log in via SSH, or consoles: USB or serial (check /etc/inittab to see console settings). If you didn't change the network settings, SSH listens on and (available via LAN or WAN interfaces, so check both before reporting problems).
The default password for the "root" user is "toor", and of course you are encouraged to change it.

More information

The base system is about 170 MB (it contains some other tools like ssh-server, mc or iptraf, and that's why it's slightly bigger than the minimal system).

Kernel has ext3 support compiled, to be able to boot from ext3-formatted devices.

If you want to gain some memory, you may comment out these lines in /etc/inittab:

It's only necessary if you connect using a serial cable (first line; router's serial port), or a USB-serial cable (second line; router's USB port), and normally that's not needed after you configured your system.

Moreover, if you want to connect as root using a USB-serial cable, add ttyUSB0 line to /etc/securetty file:

If you want to ensure that your USB-stick will live longer:

  • make all logs to be written into tmpfs, like /tmp/log
  • make sure the system will use swap as little as possible (echo "0" > /proc/sys/vm/swappiness)

You can move swapfile periodically. This way you ensure that you won't over-use the swap part of your USB-stick.
NOTE: all USB-sticks do wear-leveling transparently, so normally, it's not needed to move swapfiles around. On the other hand, you never know how good/bad the wear-leveling in your USB-stick is.

1. create new swapfile (16MB in example)- dd if=/dev/zero of=newfile bs=1024 count=16384; mkswap newfile;

2. swapon newfile;

3. swapoff oldfile

4. ... edit fstab accordingly

Swap is not too large usually, so you can create several 16-32MB swapfiles at once and activate next of them according to your need (e.g. once a month/season). Keep the old swap-files; if you create new ones only when needed, you could create new swapfile where some of the previous files used to be...

How it works

The trx image was made with OpenWRT buildroot, contains the kernel only.

When you power on your device, it boots the kernel.

Then the kernel executes, and starts the system from /dev/sda1 (usually, your USB-stick, or USB-HDD), which would be Debian in this case, but you can also start any other Linux distribution capable of running on mipsel (like Gentoo).

As seen in our .config download, this is currently configured via CONFIG_CMDLINE="root=/dev/sda1 rootdelay=10 console=ttyS0,115200"

NOTE that rootdelay=10 can still be too short, especially in the case of netconsole and verbose logging. Also note that the console= statement above may prevent init from loading due to unavailable working initial console issues (serial IRQ problems or so). IOW, better use something like root=/dev/sda1 rootdelay=25 noinitrd init=/sbin/init netconsole=@,@ debug

Building your own kernel

If you want to build your own MIPS kernel compatible with ASUS, follow these steps:

1. Download openwrt build environment (revision 6850 is stable, later ones may not be stable):

At the time I built the kernel image available for download here, I used revision 6850 from 2007-Apr-03.

2. Go to trunk/ directory, and select all the required tools:

Make sure "Target System (Broadcom BCM947xx/953xx [2.6])" is selected and "Target Images" is set to "jffs2". Also, deselect almost all packages. As we want to use Debian, we don't need any OpenWRT packages. This will make our .trx image build faster; it'll be also smaller.

Leave one package, "Base system -> base-files", as it will be needed to build the .trx firmware (otherwise, .trx image will be "empty", and won't build).

3. Now, build all the tools needed for cross-compilation, and a (not yet configured) kernel:

4. Configure the kernel as you want:

5. Load the .config file (download below) as an Alternate Configuration File, and save it as .config.

6. Make a new image - start this command in trunk/:

7. You will have new images in trunk/bin/

Now we have to build modules for our new kernel:

8. Remove .image and .modules in build_mipsel/linux/

9. Go back to trunk/ directory and run make again (now it compiles also the modules we want)

10. Put modules temporary somewhere (INSTALL_MOD_PATH is where we want to temporary put modules)

11. Now we have in /temporary/path/lib/modules/$our_kernel_version our modules and we have to copy them on the router in /lib/modules/

12. Log as root on the router and adjust permissions

13. Flash the image as explained before and that's it

For a more detailed explanation of what the above steps are doing, see (in particular, the "Building openwrt" section)

ASUS WL-500g Deluxe notes

By default, only four LAN ports are enabled. WAN port is disabled.
To enable WAN port, add this command to your startup scripts:

You need to have robocfg command, you can get it in the download section.

ASUS WL-500g Premium notes

By default, only the WAN port is enabled. The four LAN ports are disabled (note: it may differ on different models[on mine no ports were enabled till following the first item]).

To enable the LAN ports, add these commands to your startup scripts:

If it doesn't work, try:

Different vlan for each port: To configure multiple networks on the switch.



Intarface eth0 is used like fallback if is not run or configured properly. than you can access from WAN or LAN1 (I'm not sure which)

For these configuration steps to work, you must have the robocfg command, which is available in the download section.

See architecture description:

ASUS WL-700gE notes

Once debian starts it uses the fourth LAN port, robocfg hasn't been tested.

A custom OpenWrt build must be used initially. This is required to partition and format the hard disk. Partitioning and formatting tools will probably not fit in the 2MB of flash memory, These can be build as packages by the OpenWrt make script and copied over using netcat which is built into busybox. Similarly the Debian base system can be copied over using netcat and extracted in place. Remember to set a root password in Debian, (use chroot). To complete installation create a directory such as /hdd where the hard disk can be mounted, create a directory such as /hdd/flash_root where the OpenWrt / can be pivot'ed to and use a custom /sbin/init inside OpenWrt to mount the hdd, pivot and exec /sbin/init.

More detailed robocfg/vlan settings

Please see for more detailed robocfg/vlan settings.

Resetting NVRAM from Debian

After flashing with my router is no longer reachable when in the "recovery state" (i.e., ping times out); however, debian still boots fine. I have to reset nvram from the working debian system in order to flash a new image. Keep in mind that although it worked for me, it could nonetheless brick your router.

In order to reset nvram you have to:

1. Boot your router with debian and log in as root.

2. Check where nvram is

3. Install "mtd-tools"

4. Reset nvram

Nvram is clear now and you can flash your new image.

Linksys WRTSL54GS notes

Download "all kernel images" archive (from the "Downloads" section).

Inside, you will find the image for Linksys WRTSL54GS: openwrt-wrtsl54gs-2.6-jffs2.bin.


Currently, wireless doesn't work for boards with Broadcom mini-PCI. An updated kernel will be uploaded once the wireless is working in Kamikaze/OpenWRT.

Additional hardware

Go to additional hardware to see the list of additional hardware these routers were running with.


Go to downloads page.


  • openwrt-brcm-2.6-jffs2-64k.trx and openwrt-brcm-2.6-jffs2-128k.trx are not the same images as available on or other sites. It's a custom build, needed to boot Debian from /dev/sda1. If you download openwrt-brcm-2.6-jffs2-64k.trx or openwrt-brcm-2.6-jffs2-128k.trx from somewhere else, it will not boot Debian...
  • Can't connect... Network problems etc.

Add a startup script *after* the network is initialized (ex: edit /etc/rc.local).
In it, start some simple commands like:

You will see if the device has an IP address at all - just see those files on another machine. Also, check the logs etc.

You might want to add something like ping, too:

and see with a network sniffer (like tcpdump or ethereal/wireshark) on another machine if you see any packets.

  • Try to connect the network cable to a WAN port, and if it doesn't work (i.e., you still can't connect), to any of LAN ports.
  • Are you sure you're connecting from the same subnet?
  • Did you run tune2fs with proper options?
  • Did you really create an ext3-formatted partition, and not some other filesystem? The device won't boot from a USB stick with ext2, or any other filesystem.
  • A serial cable is the best way to troubleshoot all problems. If you don't feel like opening your device and using a serial cable, you can use a USB-serial cable to connect to your device (it will only have any use if the device actually boots; you won't see any kernel messages while it boots).

Or simply make use of Documentation/network/netconsole.txt

  • Wireless is currently not supported.

Contact and support

If you have any questions or want to be notified about news, please subscribe to the mailing list on This is a list with very low traffic.

For general debian-mipsel info, please ask at debian-mips mailing list.

I only have ASUS WL-500g Deluxe, but I received emails from other people who confirmed they run Debian on other models, like WL-500g Premium. On the other hand, from time to time, I receive emails from people who have problems running Debian on ASUS WL-500g Premium.

If you want Debian supported on your favourite device, you could either:

  • donate me some hardware
  • borrow me hardware for a couple of weeks

I would be very happy to accept ASUS WL-500g Premium.

To make sure Debian is well supported on mipsel architecture, please participate in Debian Popularity Contest. To do it, install popularity-contest package:# apt-get install popularity-contest