Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iptables port forwarding doesn't persist after restart [closed]

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

like image 282
dan Avatar asked May 18 '12 11:05

dan


1 Answers

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

like image 92
dan Avatar answered Oct 06 '22 10:10

dan