Iptables rules get reset after server reboot on CentOS 7

Created:

2017-07-06 18:56:18 UTC

Modified:

2017-08-16 16:18:29 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Iptables rules get reset after server reboot on CentOS 7

Applicable to:

  • Plesk for Linux

Symptoms

Unable to send emails after the CentOS 7 based server reboot .

Firewall rule that allows connection to mail server is present in Plesk.

Firewall rule that allows connection to mail server is missing in iptables:

# iptables -L -n -v | grep mail.example.com
(Empty output)

"firewalld" service is removed or disabled.

Cause

Firewall misconfiguration.

Resolution

1. Re-apply firewall rules in Plesk

1.1. Login to Plesk ;

1.2. Navigate to Plesk > Tools & Settings > Firewall > Modify Plesk Firewall rules and press Apply .

2. Set up iptables to restore the settings after reboot

2.1. Login to the server over SSH

2.2. Install "iptables-services" package

  # yum install iptables-services

2.3. Enable iptables as system service:

  # systemctl enable iptables

2.4. Save the iptables rules:

  # service iptables save

Have more questions? Submit a request
Please sign in to leave a comment.