If you'd like to automatically install tor & polipo just copy-paste as such the following script to your SSH terminal for the router:
Code:
#!/bin/sh
#written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
START=/opt/etc/init.d/S99tor
PFILE=/opt/var/run/polipo.pid
LFILE=/opt/var/log/polipo.log
PCONF=/opt/etc/polipo/polipo.conf
#user editable part end
ipkg update
ipkg install tor polipo
mkdir -p /opt/etc/polipo
cat > /opt/etc/tor/torrc << __EOF__
SocksPort 9050 # what port to open for local application connections
SocksListenAddress 127.0.0.1 # accept connections only from localhost
SocksListenAddress 192.168.1.1:9050 # listen on this IP:port also
RunAsDaemon 1
DataDirectory /opt/var/lib/tor
#StrictExitNodes 1
#ExitNodes {gb}
__EOF__
cat > ${PCONF} << __EOF__
proxyAddress = "0.0.0.0"
proxyPort = 8118
allowedClients = 127.0.0.1, 192.168.1.0/24, 10.8.0.0/24
allowedPorts = 1-65535
proxyName = "localhost"
cacheIsShared = false
socksParentProxy = "localhost:9050"
socksProxyType = socks5
chunkHighMark = 4194304 # 4M Ram Usage
objectHighMark = 1536
localDocumentRoot = ""
disableLocalInterface = true
disableConfiguration = true
dnsUseGethostbyname = yes
disableVia = true
censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535
daemonise = true
pidFile = ${PFILE}
logFile = ${LFILE}
logLevel = 0x03
__EOF__
cat > ${START} << __EOF__
#!/bin/sh
#written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
TNAME=/opt/bin/tor
PNAME=/opt/bin/polipo
CONF=${PCONF}
EXSD=/bin/sed
EXPS=/bin/ps
if [ -z "\$1" ] ; then
case \${0##*/} in
S??*) rc="start" ;;
K??*) rc="stop" ;;
*) rc="usage" ;;
esac
else
rc="\$1"
fi
TBN="\${TNAME##*/}"
PBN="\${PNAME##*/}"
case "\$rc" in
start)
if [ ! -x "\$TNAME" ]; then
echo -e "\033[1;31m\$TBN is missing, try ipkg install \$TBN\033[0m"
exit 1
fi
if [ ! -x "\$PNAME" ];then
echo -e "\033[1;31m\$PBN is missing, try ipkg install \$PBN\033[0m"
exit 2
fi
TST="\$(echo \${TNAME} | \$EXSD 's#/#\\\\/#g')"
PST="\$(echo \${PNAME} | \$EXSD 's#/#\\\\/#g')"
echo "Starting \$TBN and \$PBN"
if [ -n "\$(\$EXPS | \$EXSD -n '/.*'''\$TST'''/p')" ]; then
echo -e "\033[1;33m\$TBN runs already\033[0m"
else
\${TNAME}
sleep 1
fi
if [ -n "\$(\$EXPS | \$EXSD -n '/.*'''\$PST'''/p')" ]; then
echo -e "\033[1;33m\$PBN runs already\033[0m"
else
rm -f ${PFILE}
\${PNAME} -c "\$CONF"
fi
;;
stop)
echo "Stopping \$TBN and \$PBN"
killall \${TNAME##*/}; killall \${PNAME##*/}
;;
restart)
echo "Restarting \$TBN and \$PBN"
"\$0" stop
sleep 2
"\$0" start
;;
*)
echo "Usage: \$0 (start|stop|restart|usage)"
;;
esac
__EOF__
chmod u+x ${START}
${START} start
It will create the following files (save them if you have some of them already):
/opt/etc/tor/torrc
/opt/etc/polipo/polipo.conf
/opt/etc/init.d/S99tor
install.tar.gz
You'll need to edit /opt/etc/tor/torrc if you have preference for exiting via tor in some country or you wish to activate the relay (check the discussion).
In /opt/etc/polipo/polipo.conf you may wish to reduce logLevel.
For more polipo options please check http://www.pps.jussieu.fr/~jch/softw...po/polipo.html
My usual single line install instead:
Code:
cd /tmp && wget -O install.tar.gz "http://wl500g.info/attachment.php?attachmentid=8479&d=1322142484" && tar xvzf install.tar.gz && ./install.sh
In my experience tor/polipo can use quite some memory/CPU time so if you plan to run many other programs on the router as well you may want to consider using RT-N16 or 128MB memory upgraded WL-500gPv1/WL-500W.
If you'd like to disable automatic startup just re-name /opt/etc/init.d/S99tor to e.g. /opt/etc/init.d/DS99tor
Enjoy!