I have a Redhat server (Red Hat Enterprise Linux Server release 7.2 (Maipo)
) that resets iptable rules on re/boot.
According to the version 6 documentation, I execute:
/sbin/service iptables save
which returns:
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
If I understand the message correctly, I attempted the following:
sudo systemctl iptables save
which returns:
Unknown operation 'iptables'.
I cannot locate the version 7 documentation on saving ip tables specifically, but previous versions support the same command.
What command should I run to save iptables config?
For reference:
firewall d satatus:
systemctl status firewalld
firewalld.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
You should install
iptables-services
package.Then
service iptables save
will work. Also these commands will work too:AFAIK, systemctl doesn't have any option to save iptables-services' configuration.
Note: systemctl syntax is as follow :
systemctl <operation> <unit>
Here is link to Security Guide for Red Hat 7: using_firewalls
I use
And status of firewalld service:
So I think, you could also enable firewalld service:
And change rules via firewall-config