Last active
April 28, 2017 15:34
-
-
Save intrd/1822496093fd081e309c339e4edc01a6 to your computer and use it in GitHub Desktop.
Forward a remote site:port to a localhost:port
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 characters
#!/bin/sh | |
# Forward a remote site:port to a localhost:port | |
# @author intrd - http://dann.com.br/ | |
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/ | |
iptables -F | |
iptables -t nat -F | |
iptables -X | |
sysctl -w net.ipv4.conf.all.route_localnet=1 | |
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 34.198.94.240:32914 | |
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