Tor Package for Linksys E4200

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Philipp87
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 19

PostPosted: Sun Oct 23, 2016 11:14    Post subject: Tor Package for Linksys E4200 Reply with quote
Hi all,

I am having a Linksys E4200 with kongmod release 06/07/14 (SVN: 22000:23903M) and am searching for a working optware repository / package which I could use to install Tor.

The one pre-set in opkg coming from http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/packages/Packages.gz does not work. Tor errors out with "missing pointer..."

Entware packages coming from here http://pkg.entware.net/binaries/armv7/Packages are listed as incompatible in opkg.

The package repository mentioned in the dd-wrt wiki http://debian.keithdunnett.net/ddwrt/bcm53xx/packages/ is apparently taken offline.

Could someone recommend me a working repository please which I could use with a. m. configuration?

Thanks,
Philipp


Last edited by Philipp87 on Sun Oct 23, 2016 16:04; edited 1 time in total
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6856
Location: Romerike, Norway

PostPosted: Sun Oct 23, 2016 14:42    Post subject: Reply with quote
Isn't Tor available under Services->Services Tab?

It is on my Asus RT-AC66U (Build 30771)

ftp://ftp.dd-wrt.com/betas/2016/10-18-2016-r30771/broadcom_K3X/dd-wrt.v24-30771_NEWD-2_K3.x_mega-e4200.bin
Philipp87
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 19

PostPosted: Sun Oct 23, 2016 15:44    Post subject: Reply with quote
Per Yngve Berg wrote:
Isn't Tor available under Services->Services Tab?


Unfortunately not. Apart from that the build is very good. No bugs so far and it runs for months without having the need to reboot, therefore I am reluctant to throw out the whole software just because of this.
Philipp87
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 19

PostPosted: Sat Oct 12, 2019 17:43    Post subject: Re: Tor Package for Linksys E4200 Reply with quote
After a while I had the time to re-look at this issue and now it worked out, but just with tor version 0.2.8.17. All others up to the latest either do not cross-build or do not run. It looks like the code for MIPS32 processors is not well tested in those packages.

Here is how it worked for me which I hope will help someone who tries to compile something for the E4200.

Assumption is that you have an USB drive connected to the router which has a jffs partition and ideally also a swap partition as the RAM is short on that device.

Use cross compile toolchain in Ubuntu 16 x64:

Get the complete dd-wrt toolchain collection from here
http://download1.dd-wrt.com/dd-wrtv2/downloads/toolchains/toolchains.tar.xz
You just need this from that package, provided you are using dd-wrt v24 sp2: toolchain-mipsel_3.3.6_BRCM24

a) rename original linker executable:
mv /usr/bin/ld /usr/bin/ld-2

b) copy the toolchain files to /usr/bin
cp -r /home/myuserid/toolchain-mipsel_3.3.6_BRCM24 /usr/bin/

c) Use the Ubuntu update-alternatives to switch the symlinks to gcc and ld:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/ld ld /usr/bin/ld-2
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/toolchain-mipsel_3.3.6_BRCM24/bin/mipsel-linux-uclibc-gcc 40 --slave /usr/bin/ld ld /usr/bin/toolchain-mipsel_3.3.6_BRCM24/bin/mipsel-linux-uclibc-ld
sudo update-alternatives --config gcc

d) use the include directory (header files) of the toolchain
mv /usr/include /usr/include-5
ln -s /usr/bin/toolchain-mipsel_3.3.6_BRCM24/include /usr/include

d) In order to switch back to standard gcc/ld:
Remove the toolchain folder and run:
sudo update-alternatives --config gcc

use original include files
unlink /usr/include
ln -s /usr/include-5 /usr/include


1) libevent

Download: https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
Unpack gzip -cd < libevent-2.1.11-stable.tar.gz | tar xvf -


./configure --prefix=/jffs/torlib --disable-samples --host=mips-openwrt-linux-uclibc --disable-shared --enable-static --with-pic
make
make install

Docs/Help:
https://libevent.org

2) openssl

Download: https://www.openssl.org/source/openssl-1.0.2t.tar.gz
Unpack gzip -cd < openssl-1.0.2t.tar.gz | tar xvf -


./Configure linux-mips32 no-shared no-dso --prefix=/jffs/torlib
make
make install


Docs/Help:
https://www.openssl.org/source/

3) zlib

Download: https://zlib.net/zlib-1.2.11.tar.gz
Unpack gzip -cd < zlib-1.2.11.tar.gz | tar xvf -

./configure --prefix=/jffs/torlib
make
make install

Docs/Help:
https://zlib.net/


4) tor

Download: https://www.torproject.org/download/tor/
Previous versions: https://archive.torproject.org/tor-package-archive/
Unpack gzip -cd < tor-0.2.8.17.tar.gz | tar xvf -

./configure --prefix=/jffs/tor --disable-gcc-hardening --enable-static-tor --with-libevent-dir=/jffs/torlib --with-openssl-dir=/jffs/torlib --with-zlib-dir=/jffs/torlib --host=mips-openwrt-linux-uclibc --disable-tool-name-check
make
make install

Tor Configuration

As above instruction creates a fully static tor, you just have to copy over the /jffs/tor folder to the router.

Besides the standard settings, I do recommend to enter the following into the torrc file:

DataDirectory /jffs/tor/var/lib/tor/
RunAsDaemon 1
AvoidDiskWrites 1


Last edited by Philipp87 on Sun Oct 13, 2019 8:26; edited 1 time in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sun Oct 13, 2019 0:10    Post subject: Reply with quote
Why would you use the K24 toolchain? That makes no sense.
Philipp87
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 19

PostPosted: Sun Oct 13, 2019 8:28    Post subject: Reply with quote
kernel-panic69 wrote:
Why would you use the K24 toolchain? That makes no sense.


Because I am using V24SP2 from Kong as this is the best performing version for this oldie.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sun Oct 13, 2019 11:25    Post subject: Reply with quote
Philipp87 wrote:
kernel-panic69 wrote:
Why would you use the K24 toolchain? That makes no sense.


Because I am using V24SP2 from Kong as this is the best performing version for this oldie.


It would've been easier to install FreshTomato mega-VPN.
Philipp87
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 19

PostPosted: Sun Oct 13, 2019 12:39    Post subject: Reply with quote
kernel-panic69 wrote:

It would've been easier to install FreshTomato mega-VPN.


Do you have an E4200 with FreshTomato and could share your experience on stability, features and performance?

For me the whole package counts, not just if it has Tor.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Oct 15, 2019 12:13    Post subject: Reply with quote
"An" equals about 5 these days. Currently, only one is being used to test DD-WRT public beta releases, one is being used for stock firmware development, and another is for FT development/testing. The other two are flashed with the last public beta of FT, and are spares. I personally have never had an issue with FT out of the box except a misconfiguration-induced problem. That's about where I'll stop my commentary because I've probably said too much already.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum