Last active
August 29, 2015 14:01
-
-
Save dekart/8dd552284c843dd456c0 to your computer and use it in GitHub Desktop.
Iptables setup for port forwarding on local dev machine.
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
Should be added to /etc/network/if-pre-up.d/iptable_rules | |
Don't forget to run | |
chmod +x /etc/network/if-pre-up.d/iptable_rules |
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
#!/bin/sh | |
iptables -t nat -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 127.0.0.1:3000 | |
iptables -t nat -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 443 -j DNAT --to-destination 127.0.0.1:3001 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment