I've added support for the BT Voyager 2110 to OpenWrt. A patch has been submitted to the openwrt-devel mailinglist, and has been accepted to trunk. If you aren't comfortable with compiling OpenWrt from source, I've uploaded precompiled binaries based on trunk r26936. Just be aware that OpenWrt does not support the ADSL functionality of this router yet (waiting on Broadcom to release the ADSL driver source code).

I take no responsibility for any bricked devices, although if you manage to do it please tell me! It's actually quite difficult to properly brick a brcm63xx device with a CFE bootloader.
openwrt-BTV2110-squashfs-cfe.bin
openwrt-BTV2110-jffs2-64k-cfe.bin
openwrt-BTV2110-jffs2-128k-cfe.bin
Posted: May 20th, 2011
Categories:
OpenWrt DDWRT
Tags:
BT Voyager 2110,
BTV2110,
OpenWrt,
V2110
Comments:
7 Comments.
ngrep is a powerful tool which enables network administrators to view packets travelling across the wire in real time. This is a useful item for both security audits and reverse engineering.
By running ngrep on router level devices, it is possible to see where closed source devices such as Playstations and Wiis are phoning home for updates.
Below is a sample command run on my router to view all traffic on interface br0, travelling to or from host 192.168.1.19.
ngrep -q -d br0 -W byline host 192.168.1.19
I ran a simple wget on 192.168.1.19 to generate traffic.
T 192.168.1.19:59119 -> 78.137.166.3:80 [AP]
GET / HTTP/1.0.
User-Agent: Wget/1.12 (linux-gnu).
Accept: */*.
Host: dereenigne.org.
Connection: Keep-Alive.
.
T 78.137.166.3:80 -> 192.168.1.19:59119 [AP]
HTTP/1.1 200 OK.
Date: Mon, 28 Feb 2011 02:09:50 GMT.
Server: Apache/1.3.41 (Unix) PHP/5.2.5.
X-Powered-By: PHP/5.2.5.
Connection: close.
Content-Type: text/html.
X-Pad: avoid browser bug.
.
Hello, World!
The results can also be dumped to a pcap file for later examination in Wireshark by using the -O argument.
ngrep -d eth0 -O /tmp/capture.pcap
ngrep will obviously need root privileges if it is to sniff packets.
Posted: February 28th, 2011
Categories:
Linux,
OpenWrt DDWRT
Tags:
ngrep,
traffic snooping
Comments:
No Comments.
Bittorrent is a peer to peer protocol for sharing files over the internet. Bittorrent reduces the bandwidth costs required to distribute a file over the internet by allowing users to upload to new users once they have downloaded the file. Rather than leave a computer on all the time to seed torrents, I decided to install the Transmission Bittorrent client on my Netgear WNR3500L router, and put that USB port to good use.

I have the WNR3500L's USB port populated with a 8GB MicroSD card using one of these little adapters from DealExtreme, which is plenty big enough for storing a few Linux ISOs to share. Installing Transmission on a DD-WRT based router is pretty easy. Assuming you have already installed Optware, telnet/SSH to the terminal of your router and run:
ipkg-opt update
ipkg-opt install transmission
Transmission is now installed on your router, but you must take additional steps to complete the setup. In this example, I am storing my torrents in the /jffs/torrent/ directory which is mounted on the MicroSD card. Running transmission-daemon with no arguments uses ~/.config as your configuration directory, which it also creates if it doesn't already exist. A slight problem exists with this though; ~/ is mounted as a ramfs filesystem. The solution to this is to run transmission-daemon with the -g argument, which allows you to specify a different configuration directory; one that is not wiped at every reboot perhaps.
transmission-daemon -g /jffs/torrent/.config/transmission-daemon
killall transmission-daemon
This will generate the directory structure that transmission-daemon requires. The configuration parameters can then be edited by editing the settings.json file.
vi /jffs/torrent/.config/transmission-daemon/settings.jsonThis page gives a good overview of what aspect of the program each of the settings is responsible for. When you have tweaked the settings to your liking, the daemon can be started by running the following command./opt/bin/transmission-daemon -g /jffs/torrent/.config/transmission-daemon To make transmission-daemon run everytime the router powers on, it can be added as a startup script, or by adding an entry to /opt/etc/init.d. The final step is to add a firewall rule to allow incoming connections on the peer-port port you have specified in your settings.json file. As an example, I have used 12345 below.
iptables -I INPUT 1 -p tcp --dport 12345 -j logaccept
When running, you can access the web interface on the rpc-port specified in settings.json. In the screenshot below, I run my webinterface on port 81.

The reason this post is entitled Bittorrent Seedbox rather than Bittorrent Client, is that I have not been able to successfully download any decent sized torrents (500MB+) without this switch locking up and requiring a manual power cycle. I'm not quite sure what causes the lockup either, and I haven't had the time to probe the log using a serial cable after it has locked up either. However, it still functions correctly for seeding torrents, which is all I want it for really.
To add torrents, I simply wget the files I want to seed to the torrent directory, and then add the .torrent file using the web interface. After completing the hash checks, the files should begin seeding.
Don't be afraid to impose speed limits. I have limited my upload speed to 20KB/sec. You'd be surprised how much bandwidth that runs up over the course of a month.

Most people think of their home router as simply the little black box with the flashy lights that provides the house with internet. They'd be correct, but there is whole lot more that those black little boxes can do. It is possible to run an embedded version of Linux on selected (mainly Linksys) models. This means that you can make your router perform the same tasks as a dedicated Linux server in your network, at a fraction of the energy costs. This whole project started when Linksys where required to release the source code to their firmware under the terms of the GNU GPL.
The two major versions of Linux firmware available for routers today are OpenWRT and DD-WRT. OpenWRT is the most powerful of the two, but is mainly command line based. This makes it more suited to embedded systems. DD-WRT has the best Web Interface of the two, and it more suited to replacing stock firmware on home routers. People want a nice WebUI when something goes wrong, not looking at /var/log/messages on a terminal.
OptWare is a lightweight package system that originated on the NSLU2 Unslung system, but has since become the de facto standard package manager for embedded Linux systems. DD-WRT does not support these packages by default, but can be easily configured to support them. The OptWare package library contains lots of applications that people may already have heard of such as MySQL, Transmission, Asterisk, OpenSSH, Apache, nginx, PHP and Vlc.
If you plan on installing OptWare packages on your router, you will require space to store them. Most routers have lots of RAM space but little NVRAM. The difference being, that the latter does not lose its contents when the power is lost. Clearly, having to reinstall your applications to RAM on every powerup is not going to work in the long term. This means that applications must be installed to a partition that will not be wiped if the power is lost. This can be in the form of USB storage if your router has a USB port, or a JFFS partition if you have left over space in your NVRAM when your firmware is loaded.
Before you install, you must set up your /jffs dir. This can be done by either binding a USB disk to /jffs or using the Web Interface to configure a JFFS filesystem from unused NVRAM.
To install, either telnet or ssh to your router (you may need to enable telnetd or sshd in the web interface first) and type the following command to download the install script:
wget http://dereenigne.org/wp-content/uploads/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
Then execute the script:
sh /tmp/optware-install.sh
Once your script has completed, you should be ready to go. To see what applications you can install, type:
ipkg-opt update
ipkg-opt list | more
To install, type:
ipkg-opt install PACKAGENAME
I'll do a more posts at a later date with guides how to configure some of the more tricky packages such as setting up a BitTorrent client and enabling SFTP access to the filesystem.
Posted: August 13th, 2010
Categories:
OpenWrt DDWRT
Tags:
ddwrt,
JFFS,
Linksys,
Linux,
optware
Comments:
3 Comments.
I recently discovered Pachube. Pachube is basically the YouTube of the graphing world. You create the data, and then send it up to Pachube to be plotted.
I use both DDWRT and OpenWrt firmwares on my routers around the house. They both are Linux based, running the 2.6 Kernel. I wanted to log the bandwidth use in the the house on an hourly basis, but neither firmware provides an easy way to measure it. I wrote this script to parse /proc/net/dev for the data for the appropriate interface and send this to Pachube. This script averages the difference between two interval across the whole interval. I may rewrite this using environmental variables so that it can be used with cron, but at the moment it works for me and I'm happy with it. I'm also aware this could be done more efficiently in Perl, but I kept it in BASH because these devices only have 4MB of ROM, and do not have space for the Perl binaries.
Setup Instructions:
- Create a new Pachube feed with two parameters; ID 0 being upload and ID 1 being Download.
- Personalise the script below and upload to your router as bandwidth.sh
- Grant the script permission to execute:
chmod +x bandwidth.sh
- Run the script in the background:
sh bandwidth.sh &
#!/bin/bash
# variables
#sleeptime in seconds
#dont set too low or you may exceed the pachube api rate limit
sleep=60
#wan interface varies from device from device
#ifconfig should show you
net_iface=vlan2
#pachube details
pachube_api_key="API_KEY"
pachube_feed="0000"
eval `cat /proc/net/dev | grep $net_iface | cut -d ':' -f 2 | awk '{print "rx_old="$1";tx_old="$9}'`
while [ 1 ]
do
sleep $sleep
eval `cat /proc/net/dev | grep $net_iface | cut -d ':' -f 2 | awk '{print "rx="$1";tx="$9}'`
let tx_diff=$(((((($tx-$tx_old))/1024))/$sleep))
let rx_diff=$(((((($rx-$rx_old))/1024))/$sleep))
curl --request PUT --header "X-PachubeApiKey: "$pachube_api_key --data $tx_diff,$rx_diff "http://www.pachube.com/api/"$pachube_feed".csv"
tx_old=$tx
rx_old=$rx
done
Live graphs from my router at home:


Posted: July 30th, 2010
Categories:
OpenWrt DDWRT
Tags:
Bandwidth,
Linux,
OpenWrt,
Pachube
Comments:
6 Comments.