Save iptablesOfFirewallThe rules are as follows:
Solution:
The rules created by the iptables command are temporarily stored in the memory. If the system restarts before permanently saving these rules, all the rules will be lost. If you want the rules set by iptables to take effect after the system is restarted next time, you need to permanently save these rules and run them as root:
/Sbin/service iptables save
This operation runs the iptables initialization script, which runs the/sbin/iptables-save program and updates the current iptables configuration file/etc/sysconfig/iptables.
The original configuration file is saved as iptables. save.
The next time the system starts, the iptables initialization script will use the/sbin/iptables-restore command to re-read the content of the/etc/sysconfig/iptables file.
Therefore, it is better to check the rule before submitting a new iptables rule to the/etc/sysconfig/iptables file. You can also apply the iptables configuration file in other versions of the system here. This helps to distribute the configuration file to multiple Linux Hosts.
Note: After distributing the/etc/sysconfig/iptables file, each system will execute the/sbin/service iptables restart command to make the rule take effect.
The article shows whether the above method is used to solve the problem of saving the firewall rules of iptables. Share it with your friends!