Configuring TOR + OpenVPN

Since I wanted all my traffic to go through Tor. Not only HTTP(s) but ALL traffic (nmap, sqlmap and other utilities are in scope).

nmap works silly and I don’t know why yet. It shows every port as open.

I’ve used this article. It really helps because it’s really hard and annoying to keep all these commands in mind.

Install Tor like always (not bundle).

Then add the following to the end of torrc file:

AutomapHostsOnResolve 1
TransPort 9040
DNSPort 53

May be you’ll need to change to your OpenVPN address.

Then we use the script to update iptables rules and route our traffic through Tor:



iptables -t nat -A PREROUTING -i $_int_if -p udp --dport 53 -j REDIRECT —to-ports 53
iptables -t nat -A PREROUTING -i $_int_if -p tcp  --syn -j REDIRECT —to-ports $_trans_port

To work with onions site you should use Tor DNS. To do so change the line with DNS to:

push "dhcp-option DNS"

That’s it. ez yep?