Focus on cloud service provider activities
Notes on website operation and maintenance

Solution to CENTOS7's "service iptables save" prompt error scheme

In the past, Lao Zuo still liked the CENTOS system image, but when I arrived at CENTOS7, I didn't like it. Some command codes were changed, and I didn't feel very used to them. Now I basically use DEBIAN and UBUNTU, but sometimes I still need to use CENTOS. At present, the latest version is 8. X, but generally we don't use the latest version, so we will use CENTOS7. X.

When we need to execute the iptables firewall, you can use the "service iptables save" command. For example, an error will be prompted:

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.

Let's see how to solve it.

systemctl stop firewalld
systemctl mask firewalld

Let's close the firewall first, and then prepare to install the components.

yum install iptables-services -y

Because the systemctl command is used by default, you need to install the iptables service first, which is not available by default.

systemctl enable iptables

Then set the startup.

systemctl restart iptables

The restart takes effect. Finally, let's try the command again. It should be available.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( one )
Do not reprint without permission: Lao Zuo's Notes » Solution to CENTOS7's "service iptables save" prompt error scheme