iptables port forwarding doesn't persist after restart

amazon-ec2, iptables, linux

Solution

I found a good blog post explaining how to do it https://help.ubuntu.com/community/IptablesHowTo

Problem

I have server instance running on amazon ec2. I want to forward from port 80 to 8080 using iptables. Which works fine until restart when it stops forwarding. I have used ``` iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080 ``` to set up fowarding. What do I need to do to make it persistant? Thanks

Original source