Some of my notes on hacking with openwrt:

The TP-LINK WR841N is probably one of the cheapest routers, available for around ~$28 AUD. Have not had a single problem with it ever. It’s not Gigabit tho.

  • TP-LINK WR841N v9 – runs Chaos Calmer 15.05 RC2 just fine. There is enough space to install LuCI, but not much else.
  • TP-LINK WR841N v8 – prebuilt images from the openwrt website include LuCI already.

NETGEAR WNR2200

  • I’ve compiled my own image here with the patches needed for the USB port to work. It does an okay job as a NAS, but is not particularly fast. Good news: extroot does work. Not Gigabit either.

Transferring a bin flash file to the router for a sysupgrade – without the LuCI web interface?

How do you get the flash file onto the router for flashing? Well, if you have python on your PC, you can very easily host a simple web server to host the flash file for access from the router. From the directory where the bin file to flash is, execute:

python -m SimpleHTTPServer 80 &

This starts a basic http server from the current directory. Now you can ssh into the router, and use wget to pull the bin file into /tmp for use with the sysupgrade command.

Help! I’ve lost access to my router in dumb AP mode (can’t access ssh, web interface) – what is it’s IP address?

I reckon it’s best to give the ‘dumb’ router a static address, which will permanently avoid this problem.

First up is to get access to the router (you currently have no idea what IP address it’s on).

If you’re on Windows, this handly little dhcpserver can help. The idea is to get your PC to temporarily act as a DHCP server so that the router will get assigned a (known) IP address. This means that you need to connect your router directly to the PC (i.e. not using wifi), and disconnect everything else from the router – otherwise the main router will still be acting as a DHCP server! The router may need a reboot.

My /etc/config/network looks something like this:

config interface 'lan'
        option ifname 'eth1 eth0' # Bridge lan and wan
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.1.1'
        option dns '192.168.1.1'
        option ipaddr '192.168.1.99' # Set a static IP address

If your using the web interface, navigate to Network > Interfaces > Lan

Help! How do I give internet access to a router in dumb AP mode (okpg update doesn’t work)!?

You will know that the router has “no internet access” if you can’t ping or wget, and see the following when running opkg update:

wget: bad address 'downloads.openwrt.org'

In /etc/config/network, you need to specify the gateway/dns to the main router. For the bridged interface, make sure you stick in the following:

option gateway '192.168.1.1'
option dns '192.168.1.1'

Where 192.168.1.1 is your actual DHCP server (in other words, the address of your main router).


Other useful things:

Tftp saves the day! 🙂

Tftp saves the day