I have a hostgator VPS that has a CENT OS. When I stop the VPS and start it again, the changes I've made to the IPTABLES won't save I've tried to save the IPTABLES and to no avail. Every time I restart the server I have to run the following in order to get the IPTABLES how I need them:
iptables -I INPUT -p tcp --dport 3000 --syn -j ACCEPT
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000
The first command opens port 3000 and the second command redirects port 80 traffic to port 3000.
When I restart or completely stop the VPS and start it again the IPTABLES startup as if I never saved them and go back to the default when I first got the VPS.
I've tried all these commands and still no joy.
I'm considering just writing a script to run the commands I need to configure the IPTABLES. Any suggestions?
FYI: I edited the /etc/sysconfig/iptables and did a service iptables save
and no luck, once rebooted it went back to Host Gator's configuration upon reset of the VPS.