Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 30246  / 2 Years ago, wed, may 25, 2022, 12:48:28

I use amazon EC2 instance which works via ubuntu. By default according security restrictions I can't bin my application to port 80, so I just bind it port 8080 and then set routing redirect from port 80 to 8080 via the following command:



iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080


But I found that when I reboot the server this settings no longer active untill I invoke this command again.



So my question is how to enable port's redirect work even if system was rebooted?


More From » 12.04

 Answers
0

You can add this command in /etc/rc.local , so it will be executed automatically after reboot .


[#26759] Thursday, May 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
berlorful

Total Points: 346
Total Questions: 90
Total Answers: 99

Location: Monaco
Member since Tue, Nov 30, 2021
2 Years ago
berlorful questions
Thu, Sep 2, 21, 10:12, 3 Years ago
Sun, May 9, 21, 20:55, 3 Years ago
Mon, Jan 16, 23, 23:19, 1 Year ago
Mon, Aug 29, 22, 05:43, 2 Years ago
;