Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question 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
    iptables ...

    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 ?

  2. #2
    This is the correct syntax:
    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $srcPortNumber -j REDIRECT --to-ports $dstPortNumbe
    This will redirect all traffic from port 80 to port 4444
    iptables -t nat -I PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 4444
    Hope this gives you a idea.

    some more info:
    How to redirect TCP ports using Linux iptables |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts