Datasheet

Use Metarouter to Implement Tor Anonymity Software
41
The first command names the new Metarouter virtual machine. The second command sets up a dynamic interface for
the metarouter the torBridge interface.
Set up scheduler to periodically reboot metarouter
/system scheduler add disabled=no interval=6h name=restartTor \
on-event="/metarouter set [find name=\"tor\"] \
disabled=no\r\
\n:delay 5\r\
\n/metarouter set [find name=\"tor\"] disabled=no" policy=\
reboot,read,write,policy,test,password,sniff,sensitive
Metarouter needs to be restarted periodically in order for the Tor image to run smoothly.
Set up Tor Relay or Bridge (optional)
The Tor Network relies on the existence of Tor relays, bridges and exit nodes. Anyone may run a relay or bridge and
the Tor web site encourages this. It is also possible to run an exit node, however doing this is outside the scope of
this article. More information about relays, bridges and exit nodes is available at the Tor Project web site.
Mikrotik Port Forward For Tor Bridge
If Tor bridge is desired, port 443 tcp needs to be reachable from the external network. In RouterOS:
/ip firewall nat
add chain=dstnat in-interface=ether1 protocol=tcp dst-port=443 \
action=dst-nat to-addresses=10.192.168.2 to-ports=443 disabled=no
Mikrotik Port Forward For Tor Relay
If Tor relay is desired, port 9001 tcp needs to be reachable from the external network. In RouterOS:
/ip firewall nat
add chain=dstnat in-interface=ether1 protocol=tcp dst-port=9001 \
action=dst-nat to-addresses=10.192.168.2 to-ports=9001 disabled=no
Metarouter console configuration
The next step is to configure Tor in the OpenWRT metarouter. There are several pre-written Tor configuration files
in /etc/tor. To run a bridge or relay, copy the relevant file to the running configuration and restart Tor as in the
following example. torrc.bridge is the bridge configuration, torrc.relay is the relay configuration and torrc.client is
the client-only configuration. By default, the torrc.client configuration is enabled.
root@OpenWrt:/# cd /etc/tor
root@OpenWrt:/etc/tor# ls -l
-rw-r--r-- 1 root root 7141 Aug 18 00:44 torrc
-rw-r--r-- 1 500 500 7219 Aug 18 00:43 torrc.bridge
-rw-r--r-- 1 500 500 7143 Aug 8 00:49 torrc.client
-rw-r--r-- 1 500 500 7141 Aug 8 02:16 torrc.relay
root@OpenWrt:/etc/tor# cp torrc.relay torrc
root@OpenWrt:/etc/tor# /etc/init.d/tor stop
root@OpenWrt:/etc/tor# /etc/init.d/tor start
Aug 18 00:45:18.889 [notice] Tor v0.2.1.26. This is experimental software. Do no