Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
EC2 Amazon Linux AMI port prerouting with NAT iptables
# 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