iptables rules not up after reboot
Hi All
sorry I'm new on cpanel and on this forum.
I tried to setup some fw rules on my cpanel.
I wrote this in the root shell :
iptables -L shows :
It's ok. I do:
vi /etc/sysconfig/iptables shows :
Now if I reboot, iptables -L does not show the rules :
If i restart iptables. service iptables restart, ptables -L shows my rules
My question is simple : How can i get my iptables rules up just after a reboot ? Thank you in advance for your help !
iptables -I INPUT 1 -p tcp --dport 3306 -j DROP
iptables -I INPUT 1 -p tcp -s --dport 3306 -j ACCEPTiptables -L shows :
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere tcp dpt:mysql
DROP tcp -- anywhere anywhere tcp dpt:mysql
acctboth all -- anywhere anywhere It's ok. I do:
service iptables savevi /etc/sysconfig/iptables shows :
-A INPUT -s /32 -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j DROPNow if I reboot, iptables -L does not show the rules :
Chain INPUT (policy ACCEPT)
target prot opt source destination
acctboth all -- anywhere anywhere If i restart iptables. service iptables restart, ptables -L shows my rules
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere tcp dpt:mysql
DROP tcp -- anywhere anywhere tcp dpt:mysql
acctboth all -- anywhere anywhere My question is simple : How can i get my iptables rules up just after a reboot ? Thank you in advance for your help !
-
Ok i found the answer myself :) chkconfig iptables on
thx to the "similar thread" section at the bottom. Now I'll try to find what ports needs to stay open to keep cpannel work.0 -
Hello :) I am happy to see you were able to resolve the issue. Note that you may want to consider using a third-party firewall management utility such as CSF: [url=http://configserver.com/cp/csf.html]ConfigServer Security & Firewall Thank you. 0
Please sign in to leave a comment.
Comments
2 comments