I try to set up a Ubuntu System that routes all traffic through a socks5 ssh tunnel to a Debian proxy machine. tcpsocks https://github.com/vi/tcpsocks seems to do this, but I failed to set it up. I have found this Routing all traffic thru socks proxy using ssh -D but it didn't help me that much. Does anyone have a howto for this? And do I need a SOCKS5 Server on the Proxy machine or is OpenSSH sufficient?
On the Ubuntu Client I did the following:
# # Prepare iptables: # iptables -t nat -N QQQ # iptables -t nat -A QQQ -d 22.214.171.124 -p tcp --dport 22 -j RETURN # iptables -t nat -A QQQ -p tcp -j REDIRECT --to-ports 1234 # iptables -t nat -I OUTPUT 1 -j QQQ # iptables -t nat -I PREROUTING 1 -j QQQ $ # connect to SSH: $ ssh -D 127.0.0.1:1080 email@example.com $ # start tcpsocks: $ tcpsocks 0.0.0.0 1234 REDIRECT REDIRECT 127.0.0.1 1080
That should be sufficient in order to run, right? On the Server I did nothing, I just installed OpenSSH. What's wrong with that?