Tuesday, February 18, 2014

Running a Tor relay on a TP-Link TL-WR741ND

... is not possible (for now).
It tuns out even the spacious 32 MB RAM on the 741 is not enough for Tor.
Even with a custom minimized firmware, logging in via serial so I can kill dropbear and save a meg of RAM, this is not enough.
I was able to get to ~70% of the setup, with about half of the caches loaded when the system went out of memory.
I tried to put the caches into a compressed loopback image with

# rm -rf /var/lib/tor/*
# mkdir /tmp/jffsroot
# mkfs.jffs2 --pad=0x500000 -o /tmp/rootfs.jffs2 -e 0x4000 -n -d/tmp/jffsroot
# losetup -f
/dev/loop0
# losetup /dev/loop0 /tmp/rootfs.jffs2
# modprobe block2mtd
# echo "/dev/loop0,131072" > /sys/module/block2mtd/parameters/block2mtd
# mount -t jffs2 -o rw /dev/mtdblock6 /var/lib/tor
# chown tor /var/lib/tor


but it only helped a little bit, mostly because their contents does not compress well. The tor binary kept growing in RAM and eventually reached about 20 MB. Then I was out of memory again.
So it looks like it might only be possible to run Tor with the caches located on an external storage, provided Tor's RAM usage won't grow over ~25 MB.

No comments:

Post a Comment