I have an OpenVPN server and I want to be able to route all requests that are made to that OpenVPN server through a proxy, so that the requests will look like they are made be the internet address of the proxy. For example, a normal request looks like this:

request -> openvpn -> send data back to user with the IP of the machine

When I want it to go through TOR or a proxy:

request -> openvpn -> tor or proxy -> send data back to user with the IP of the proxy

Is this possible? If so, how can I do it?


For this, I'm assuming that you have installed tor using apt-get install tor and not using the TOR browser bundle.

  1. Add this line to the /etc/tor/torrc file to tunnel VPN traffic:

    SocksPort 9150 PreferSOCKSNoAuth
  2. Then you will need to tell OpenVPN to use a proxy. Add this to your VPN config file:

     socks-proxy localhost 9150
  3. Restart tor:

    sudo service tor restart
  4. Now you should be able to run OpenVPN AFTER tor has established a connection to the TOR network.

    sudo openvpn --config path/to/vpn/config/file
  • This doesn't work for me, I'm portsharing 443 (on 4433) with nginx and when I add those two lines to the OVPN config everything fails. Any ideas appreciated. – donkey Jul 26 '16 at 12:14
  • Are you supposed to put the socks-proxy lines in the server side or client side config file? – bcmcfc Jan 16 '17 at 17:58

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.