Home  >  Article  >  Operation and Maintenance  >  What to do if Linux cannot start iptables

What to do if Linux cannot start iptables

WBOY
WBOYOriginal
2022-07-21 16:41:152824browse

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.

What to do if Linux cannot start iptables

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What to do if linux cannot start iptables

Problem description:

Enter "service iptables status" to view the status, prompt: iptables: Firewall is not running.

What to do if Linux cannot start iptables

Enter "service iptables start" to start iptables, prompt: iptables: No config file. [WARNING].

What to do if Linux cannot start iptables

Enter "ls /etc/sysconfig/" to view, but the configuration file iptables was not found.

What to do if Linux cannot start iptables

Solution:

1. Create a new rule (in this case, iptables -P OUTPUT ACCEPT).

What to do if Linux cannot start iptables

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    ]

What to do if Linux cannot start iptables

Enter "ls /etc/sysconfig/" again to view the discoverable configuration file (in the blue box in the picture below).

What to do if Linux cannot start iptables

#3. Enter "service iptables start" to start.

What to do if Linux cannot start iptables

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn