Symptoms
-
Custom iptables rules are reset after a system reboot on a Plesk for CentOS 7 or CloudLinux 7 server
- firewalld system service is removed or disabled
Cause
The iptables-services package is not installed, therefore, the custom iptables rules are not applied after a server restart.
Resolution
Warning: The package iptables-services might cause incompatibility issues with Imunify360. Make sure to stop Imunify360 before applying these steps and start the service after.
Apply the following steps:
Click on a section to expand
1- Add the custom iptables rules
-
Add the custom iptables rules manually
-
If Plesk Firewall is installed:
-
Go to Tools & Settings > Firewall > Modify Plesk Firewall rules > Click Apply
2- Save iptables rules persistently
-
Connect to the server via SSH
-
Install the iptables-services package:
# yum install iptables-services
-
Disable firewalld, enable iptables system service and start it:
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl mask firewalld
# systemctl enable iptables
# systemctl start iptables -
Save the iptables rules:
# service iptables save