I am using Tor for quite a while now and it got really fast over the years. Meanwhile there are several options to run traffic through Tor and one of them is using a “dockerized” container. The most used image is probably the one from this repository: torproxy-by-dperson. And to run all traffic through this docker it was necessary to do some iptables, but luckily there was also a shell script given.

Unfortunately, there was no proper reset functionality built-in while using this script. Thus, I decided to write that feature. I used iptables-save and iptables-restore to play with iptables. Furthermore, the script creates, starts and stops the docker container using the script.

You can find the script here: tor-route-all-traffic

You can start routing all your traffic through Tor by using the following command:

sudo ./tor-route-all-traffic.sh

And you can restore your previous configuration using the following command:

sudo ./tor-route-all-traffic.sh -restore

Sources

# Ressource URL
0 Code Github:torproxy