3

Is it possible to configure openVPN to route all client connections through a socks port? ie, I want the setup to be:

Client -> openvpn server -> localhost socks5 port -> socks5 port forward -> the internet
machine 1    machine 2           machine 2              machine 3

How would I go about doing that?

So far I've been doing the same thing but with an SSH tunnel instead of vpn and while it's been working fine, I'm going to be adding new devices which don't do ssh tunneling as well as vpn.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
Ramo
  • 43
  • 2
  • 6

2 Answers2

1

I don't think you can.

SOCKS isn't a networking (layer 3) protocol, it's a layer-4 protocol, up with the rest of the applications. Leaving OpenVPN (which does operate at layer 3) out of the picture, clients normally have to be SOCKS-aware if they want to route their traffic via a SOCKS proxy. Each piece of client software has to know where the SOCKS proxy is, each has to know how to open a SOCKS connection via that proxy, and so on.

When you add OpenVPN into the picture, it doesn't suddenly make the end-client applications brighter. Nor does a remote OpenVPN server have the ability to magically enagage in SOCKSification for any client traffic that passes along it.

OpenVPN is SOCKS-aware to the extent that it can build its tunnels to remote end-nodes via a local SOCKS proxy, but I believe that's as far as it goes.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
1

MadHatter's answer is correct, however I suspect this is a case of XY Problem. If you terminate OpenVPN on a machine that is capable of routing and NATing traffic (read: any modern server operating system) then it is absolutely possible to configure OpenVPN and the said machine to act as a network proxy in the sense that client connections will appear on the public internet as if they are coming from the proxy machine. If this is the problem you're trying to solve, iptables NAT and some routing tweaks works great for me.

Mike Seth
  • 11
  • 1