I'm using Linux/Debian and living in Iran, where you may know, Internet traffic is monitored here and censorship blocks users access to many websites & services and makes anonymity much harder.
unfortunately, all IPs used by Tor would be blocked everyday! Tor browser can bypass this censorship but I have no idea how to do the same with proxychains in command line.
And even by using Tor browser, ISP still knows I'm using Tor. So it came to my mind to tunnel all Tor traffic through a VPN to hide from ISP.

There are a lot of explanations on advantages and disadvantages of using VPN alongside Tor and how many topologies are possible to stay anonymous from ISP such as:

Client > VPN > Node1 > Node2 > Node3 > Server  
Client > Node1 > Node2 > Node3 > VPN > Server  
Client > VPN1 > Node1 > Node2 > Node3 > VPN2 > Server  

of course in some cases VPN provider would know you are using Tor and some information leaks. But regardless of VPN, I want to hide my Tor traffic from ISP.
I use "openconnect" as my default VPN and I know VPN server is outside of country.
But the main problem comes when I try to tunnel Tor traffic through a VPN in action.

To be more specific, I want proxychains to connect to Tor while all Tor traffic transfers through a VPN
Client > Proxychains > Tor > VPN > Node1 > Node2 > Node3 > Server
Tor works on port 9050 by default (Tor browser on port 9150) so last lines of proxychains configuration file must be like this:

# add proxy here ...
# meanwile
# defaults set to "tor"
socks5 9050

And I make sure if Tor service is running

sudo service tor status

So far, proxychains connects to Tor properly but connection fails because of censorship!
now, how to tunnel Tor traffic through VPN (openconnect or any other) so I can bypass ISP censorship and stay anonymous on web at the same time?
can I use port forwarding, like 9050 to VPN's port?

  • Why don't you tell us a little more about this cryptic comment, So far, proxychains connects to Tor properly but connection fails because of censorship! ? Oct 10 '16 at 5:56
  • @MariusMatutiae Well, I already said a little about censorship applied in my country. proxychains connects to Tor perfectly but still Tor gets stuck in connecting to nodes. I need to tunnel Tor traffic so it can bypass censorship, like all traffic goes outside of country without drawing attention of smart censorship applied, then from outside Tor cat connect to node. this action needs a specific topology, where proxychains connects to localhost:9050 and Tor should be connected to somewhere like localhost:xxxx to be connected to VPN! I'm trying to find a way to see if it's possible
    – user650292
    Oct 12 '16 at 10:56

Now, you can try to set up tor on the VPN, and use reverse SSH to route a remote port to a local port. Look up the reverse SSH syntax - I will give a brief version here. If you do (from local)

ssh -R port1:remotehost:port2 ......

Then you are letting the remote server to access your local port2 from the remote port1. I haven't tried this, but I believe the Tor port is 9050, and if you just hookup the local 80 with remote 9050, you should have what you described in the post. Now, whether this setup should bypasses the censorship is another matter, since your ISP provider might very well censor shady (in their respect) SSH traffic as well.

Your Answer

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