Created
May 23, 2014 14:55
-
-
Save dsabanin/e53abc60fe8d7136d5a1 to your computer and use it in GitHub Desktop.
Revisions
-
dsabanin created this gist
May 23, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/bin/sh TARGET_HOST=9.9.9.9 TARGET_PORT=22 PROXY_PORT=23 echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $PROXY_PORT -j DNAT --to $TARGET_HOST:$TARGET_PORT iptables -t nat -A PREROUTING -p tcp --dport $PROXY_PORT -j DNAT --to $TARGET_HOST:$TARGET_PORT iptables -t nat -A POSTROUTING -p tcp -d $TARGET_HOST --dport $TARGET_PORT -j MASQUERADE