Supercharge a home router using OpenWrt

Last modified on 2014-09-26

Home routers are more capable than default firmware would lead you to believe. I replace that firmware with OpenWrt: an embedded Linux distribution that converts energy-efficient, network-capable devices into much more useful hackable computers.

Let’s go!

Getting its start hacking the original Linksys WRT54G, OpenWrt and its volunteer developers now support a wide and growing range of hardware. The project hosts software packages that lay out a smorgasbord of extra possibilities: more network tools with more fine-grained controls, plus a range of server capabilities… manage printers, connect external USB drives for backup, host files/torrents/VOIP/VPNs.

I am currently using an OpenWrt-supported TP-Link TL-WR841N router (~$25CAN) with:

Not much flash storage for added packages but its a cheap and cheerful device to hack on. It has been running Barrier Breaker - the release candidate of the next upcoming version of OpenWrt - with no problems.

1. Download install image

WARNING! OpenWrt builds different install images for different devices. Consult the Table of Hardware to confirm your router is supported and read the wiki entry for your particular device to identify the correct image. It is easy to brick a device (render inoperable) using an incorrect install image.

TL-WR841N is an ar71xx device. New installs use the squashfs-factory.bin images. Download the latest RELEASE (14.07 as of 2014-10-02):

Source: openwrt-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin

2. Flash router

Log into the TP-Link router web interface (address= / user=admin / password=admin):

3. First login

Use telnet (no password) to login for the first time to OpenWrt. Use passwd to create a new root password. Once password is modified telnet is disabled. Exit and re-login using SSH …

ssh root@

Setup your internet connection either by editing /etc/config/network or using OpenWrt’s Unified Configuration Interface (UCI). Example (pppoe) setup …

uci set network.wan.proto=pppoe
uci set network.wan.username=''
uci set network.wan.password='PASSWORD'
uci commit network
ifup wan

4. Web interface

OpenWrt can be configured in the console or install the optional LuCI web interface using the opkg package manager …

opkg update
opkg install luci

After install LuCI is not running by default …

/etc/init.d/uhttpsd start      # start the web server
/etc/init.d/uhttpsd enable     # auto-start at boot

LuCI’s web server uhttpsd is configured in /etc/config/uhttpsd and LuCI itself is configured in /etc/config/luci.


5. Go further

Its exciting what you can do with these consumer routers once you let it sink in that - with a few dollars and OpenWrt - you have an extremely configurable general purpose computer:

Happy hacking!