0

Using Ubuntu 16.04 on both machines.

I've been able to share my VPN IP between devices with an ethernet cable.

The host running VPN and Tor: IPv4 Settings: "Shared to other computers" IP Address: 10.42.0.1 Subnet: 255.255.255.0

The client: IP Address: 10.42.0.2 Broadcast Address: 10.42.0.255 Subnet: 255.255.255.0 Default Route: 10.42.0.1

This configuration works fine for sharing my VPN IP, I'm not clear on how to use the Hosts Tor socksport from the client device.

1

Let Tor Listen on the Correct Address

There are a few ways to do this depending on your setup. The easiest way as someone else mentioned would be to edit your torrc config file (probably located at /etc/tor/torrc/), look for the SocksPort config option and modify it with the values you want:

SocksPort 10.42.0.1:9100 # or whatever port the client should connect on

then issue a HUP or otherwise restart the Tor process. This will cause it to start listening on port 9100 on the given LAN address.

Iptables

Alternatively, you can forward any port using a firewall. This is useful if you want more fine grained controll over how the external system accesses Tor (eg. you could also limit traffic, or only allow a certain machine to access Tor) On Ubuntu you probably have iptables, so you can create a rule like this:

-t nat -A PREROUTING -i enp0s20 -p tcp --dport 9100 -j REDIRECT --to-port 9150

(changing the interface name, enp0s20 in this example, to whatever your interface is called and the destination port from 9150 to wherever Tor is listening).

How you actually set the rule depends on your setup; you can always test it using the iptables binary:

# iptables -t nat -A PREROUTING -i enp0s20 -p tcp --dport 9100 -j REDIRECT --to-port 9150

And then persist it either using iptables-save:

# iptables-save

or you may have a rules file located in /etc/iptables or somewhere similar which needs to be modified.

pf

If you're on a system that has pf such as OS X or OpenBSD, you can add something like this to one of your anchor files (probably under /etc/pf.anchors/):

pass in on enp0s20 proto tcp from 10.42.0.2/32 to any port 9100 rdr-to 127.0.0.1 port 9050
0

just state as SockPort <your-LAN-IP-address>:<your-port> in torrc config and it will open a port. Don't forget to open a DNSListenAddress on the same IP for proper DNS leak protection!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.