Last active
August 12, 2017 19:52
-
-
Save vaporup/94809a9804efbe633094bd05f3d296a8 to your computer and use it in GitHub Desktop.
route ports to another host via iptables #iptables
This file contains 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 characters
echo "1" > /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A PREROUTING -p TCP --dport 1235 -j DNAT --to 172.30.16.107:1235 | |
iptables -t nat -A PREROUTING -p TCP --dport 8180 -j DNAT --to 172.30.16.107:49502 | |
iptables -t nat -A POSTROUTING -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment