Created
August 26, 2012 17:46
-
-
Save soarez/3481961 to your computer and use it in GitHub Desktop.
EC2 Amazon Linux AMI port prerouting with NAT 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
# List rules | |
sudo iptables -t nat -L | |
# Add rule to forward 80 to 3080 | |
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080 | |
# Will delete all rules from nat table | |
sudo iptables -F -t nat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment