Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    cpa
    cpa is offline
    Just Joined!
    Join Date
    May 2010
    Posts
    1

    Question ssh and iptables


    Hi,

    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
    Just Joined! Feeyo's Avatar
    Join Date
    Apr 2010
    Posts
    54
    This is the correct syntax:
    Code:
    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
    Code:
    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 | eHow.com

Posting Permissions

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