Created
July 28, 2017 01:42
-
-
Save zhangchenchen/d1c50c0774868dc73553838322e40305 to your computer and use it in GitHub Desktop.
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
| ## remote forward ## | |
| iptables -t nat -A PREROUTING -d LocalIP -p tcp --dport PortNumber -j DNAT --to-destination DestinationIP:Port | |
| iptables -t nat -A POSTROUTING -d estinationIP -p tcp --dport PortNumber -j SNAT --to-source LocalIP | |
| ## local forward ## | |
| iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 | |
| iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j DNAT --to 127.0.0.1:8080 | |
| iptables -t nat -A OUTPUT -p tcp -d 192.168.1.17 --dport 80 -j DNAT --to 127.0.0.1:8080 # 192.168.1.17 is localIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment