Tor

just for fun, let's see if we can get an WLAN set up that tunnels through tor.
opkg install tor (duh!)
first create a new wlan for tor in network>wifi
add, and create a new network interface 'tor'.
go to network>interfaces and configure our new interface with static ip and and a dhcp.
assign a firewall zone 'tor'. and if you're truly paranoid you can override the mac with 00:88:88:88:00:2A.


head over to network>interfaces>firewall>
select 'tor' and under advanced and ensure 'force connection tracking' is checked 
(this connection tracking isn't required, when you don't use the --syn flag or use luci rules, see below)

traffic rules to setup are faily standard
accept from wan  tcp  443 (torbridge)
acccept from tor upd 67-68 (dhcp)
accept from tor tcp 9040 (torproxy,  set port in /etc/tor/torrc)
accept from tor udp 9053 (tordns, set port in /etc/tor/torrc)
accept from tor tcp 9050 (tor socks, set ip/port /etc/tor/torcc) 
 !me thinks firewall rules block SOCKS not clear yet.
socks no t in screenshot!
now, most recipes want you to add two magical rules in firewall.user

iptables -t nat -A PREROUTING -i wlan1 -p udp --dport 53 -j REDIRECT --to-ports 9053
iptables -t nat -A PREROUTING -i wlan1 -p tcp --syn -j REDIRECT --to-ports 9040 
which look pretty much like a any-tcp to port 9040 and udp:53 to 9053 port forward.
so that's what I did (stilll need to check on the forum wether i broke something now :)

now we still need to set up tor, no luci yet.
edit /etc/tor/torrc

          SOCKSPort 10.1.0.1:9050
          SOCKSPolicy accept 10.1.0.0/16
User tor
RunAsDaemon 1
PidFile /var/run/tor.pid
DataDirectory /var/lib/tor
# This is for our transparent network
VirtualAddrNetwork 10.1.0.0/16
AutomapHostsOnResolve 1
TransPort 10.1.0.1:9040
DNSPort 10.1.0.1:9053
obviously the bits in red need to match with your port redirct, interface settings etc.
hit run: /etc/init.d/tor start

point wifi to your torrified ssid and go to: https://check.torproject.org/.

everything 'looks' okay, even though i think the socks proxy wont't be reachable because the redirect taking precedence... but hey. it works, don't fix it. :)

Comments

Popular posts from this blog

Traffic accounting

QoS with SQM (and something about bufferbloat)

Ath10k alternative driver firmware - CC15.05.1 wireless unstable