linux system and etc and sysconfig directory no iptables file solution

  • 2020-05-15 03:20:13
  • OfStack

Today, Linux was newly installed, and I hope to do some firewall strategies. When using service iptables status to check the status of the firewall, there was no response, and service iptables start was also started without chatting. It turned out that there were no iptables files in the /etc/sysconfig directory (firewall policy 1 is generally written in this file).

Reason: in the newly installed Linux system, the firewall is disabled by default. There is no firewall policy configured in 1, so the /etc/sysconfig/iptables files do not exist.

Solutions:

Write a random firewall rule in the console using the iptables command, such as iptables-P OUTPUT ACCEPT

Save service iptables save, and by default, save to iptables files in the /etc/sysconfig directory


Related articles: