Hey there,
Having some trouble rerouting traffic through a SOCKSv5 proxy running on port 1080. I'm able to get this to work, for example, by running the SSH command:
ssh -f -N -D 1080 servername
Then manually configuring firefox to use port 1080 as a proxy.
But that's easy. What I really want to do is route all http/https traffic over the proxy from any application. I turned to iptables, but haven't had any luck... Lots of google searches produce some helpful appearing information but nothing seems to work. A lack of understanding is certainly a factor. Maybe someone here can point me in the right direction.
sudo iptables -P FORWARD ACCEPT
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 1080
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 1080
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Thanks,
Nathan