2

I have a small VPS service that I use primarily to run a tor bridge (and also a VPN).

Sometimes I travel to China for work, so I have the bridge configured as unlisted and only connect to it with obfs4 - and it manages to not get blocked by the Great Firewall. For convenience I have all my various devices configured to use the bridge, even when at home.

For $5 a month, I have 1,000 GB of monthly bandwidth with this server, but I never come close to using it all. There is an option (for an extra $2 per month) to add an extra IPv4 address. I am thinking of somehow configuring tor to use one IP address as the unlisted obfs4 bridge, and to run a middle relay on the other IP address.

Are there any potential problems with doing this? If not, then are there any instructions on how I might go about this? Do I need to run two tor instances, or can I somehow do it all with one?

3

You'd need to run two Tor instances, one for the published relay and the other for the bridge.

The important part will be in specifying the correct IP address to bind to and listen on for the obfs4proxy and orports.

Assuming you had two IP addresses with 1.1.1.1 being your relay and 2.2.2.2 being your bridge, your config would look something like this

/etc/tor/torrc:

orport 1.1.1.1:9001
nickname whatever
contact user@example.com
...your other config options here...

This is just your current relay configuration.

If you're on debian using the Tor Projects repo, you should just be able to run (as root):

tor-instance-create bridge

This should create the required settings, and give it a torrc located at /etc/tor/instances/bridge/torrc, edit it following the template below

/etc/tor/instances/bridge/torrc:

# some random, uncommon and high numbered port to frustrate discovery
orport 2.2.2.2:30393
# change path as appropriate
servertransportplugin obfs4 exec /usr/bin/obfs4proxy
# some port of your choosing
servertransportlistenaddr 2.2.2.2:443
# who we are
nickname whatever
contact user@example.com
# disable socksport, we're not a client
socksport 0
# if, as your question suggests you dont want to publish it to bridgedb
publishserverdescriptor 0

Now to enable and start the newly created tor daemon instance, run (as root):

systemctl enable tor@bridge
systemctl start tor@bridge

You should be able to view the logs and ensure everything is working correctly by running (as root):

journalctl -u tor@bridge
  • I'm using Ubuntu 16.04, I just checked and I do have the tor-instance-create option - I'll give this a go as soon as I can, then mark as the correct answer. I'm assuming it will work though. Thanks! – seanlano Nov 25 '16 at 4:31
  • OK, this has worked for me! :) I actually used twice the tor-instance-create utility, so now I have two systemd services and config directories, tor@bridge.service and tor@relay.service. I disabled the default with systemctl disable tor@default.service - I figured it would be neater to manage this way. – seanlano Nov 29 '16 at 0:11

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.