ssh and iptables
I'd like to use ssh as a proxy/socks server and redirect all connections through this proxy.
It would look like :
ssh -D 123 -N host
I've never used iptables before and I did not manage to find any useful for this particular case solutions on the internet.
So, what's the good way to do that ?
This is the correct syntax:
This will redirect all traffic from port 80 to port 4444
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $srcPortNumber -j REDIRECT --to-ports $dstPortNumbe
Hope this gives you a idea.
iptables -t nat -I PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 4444
some more info:
How to redirect TCP ports using Linux iptables | eHow.com