sontek ( John M. Anderson )

October 12, 2007

Setting up openWRT

Filed under: Linux, openWRT — Tags: , , — sontek @ 12:55 am

To setup OpenWRT on your router you’ll first want to check the hardware list to make sure this is even possible. After that you just need to download the latest firmware (which is kamikaze right now). Extract the code and run make menuconfig which will bring up an ncurses setup so that you can select your favorite packages and setup the kernel. When you are done just run make and it’ll generate a folder called bin with your image in it, mine is called openwrt-wrt54gs_v4-2.4-squashfs.bin.

Now that you have the firmware file you need to transfer it to your router, the best way to do this is with a tftp client, so grab tftp with your package manager (in suse: zypper in tftp) and run the following commands:

tftp 192.168.1.1
binary
rexmt 1
timeout 60
trace
Packet tracing on.
tftp> put openwrt-wrt54gs_v4-2.4-squashfs.bin

and then power cycle your router, this will copy the new firmware over and install it, it will reboot on its own so just wait until it comes back up and then you’ll need to telnet into the router to change the root password (by default, there is no password):

telnet 192.168.1.1
root@OpenWrt:~# passwd
Changing password for root
New password:

Now you will be able to use SSH to configure the rest of the settings. By default the wireless is turned off so that it isn’t open to the world, to re-enable it you just need to edit /etc/config/wireless and comment out the line option disabled 1 by placing a pound (#) in front of it. You will probably want to setup WPA/PSK/WEP while you are in there, here is my config:

config wifi-iface
option device wl0
option network lan
option mode ap
option ssid cortex
option encryption psk psk2
option key ******

Now all you have to do is restart networking /etc/init.d/network restart and you’ll have a fresh openWRT router. On the speakeasy.net speedtest I’m getting speeds like:

Download Speed: 9895 kbps (1236.9 KB/sec transfer rate)
Upload Speed: 1565 kbps (195.6 KB/sec transfer rate)

which is about double what I was getting with the default firmware on my router.

The biggest caveat, if you aren’t familiar with doing routing in Linux with iptables, is that there isn’t a easy to
use admin site to do the configuration for you anymore, everything has to be done through ssh.

For more information you can check out the following links:

http://wiki.openwrt.org/OpenWrtDocs/Installing/TFTP
http://downloads.openwrt.org/kamikaze/docs/openwrt.html#x1-50001.1.2

Powered by WordPress