Plesk

Custom iptables rules are reset after a system reboot on a Plesk for CentOS 7 or CloudLinux 7 server

Symptoms

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

2- Save iptables rules persistently

  1. Connect to the server via SSH

  2. Install the iptables-services package:

    # yum install iptables-services

  3. Disable firewalld, enable iptables system service and start it:

    # systemctl stop firewalld
    # systemctl disable firewalld
    # systemctl mask firewalld
    # systemctl enable iptables
    # systemctl start iptables

  4. Save the iptables rules:

    # service iptables save

Exit mobile version