Home > Article > Operation and Maintenance > What to do if Linux cannot start iptables
Solution: 1. Create a new rule with the syntax "iptables -P..."; 2. Use "service iptables save" to save, and use "ls /etc/sysconfig/" to view the newly created configuration. file; 3. Use "service iptables start" to start iptables.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Problem description:
Enter "service iptables status" to view the status, prompt: iptables: Firewall is not running.
Enter "service iptables start" to start iptables, prompt: iptables: No config file. [WARNING].
Enter "ls /etc/sysconfig/" to view, but the configuration file iptables was not found.
Solution:
1. Create a new rule (in this case, iptables -P OUTPUT ACCEPT).
2. Enter "service iptables save" to save. It will prompt that it has been successfully saved to /etc/sysconfig/iptables.
iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
Enter "ls /etc/sysconfig/" again to view the discoverable configuration file (in the blue box in the picture below).
#3. Enter "service iptables start" to start.
Recommended learning: Linux video tutorial
The above is the detailed content of What to do if Linux cannot start iptables. For more information, please follow other related articles on the PHP Chinese website!