What to do if the firewall fails to be enabled under centos

王林
Release: 2020-03-27 18:10:05
Original
2613 people have browsed it

What to do if the firewall fails to be enabled under centos

Environment:

centos6.8

Problem:

In the process of configuring vsftpd, firewall configuration is required. But the startup failed.

(Recommended tutorial: centos tutorial)

The solution steps are as follows:

1. First of all, my /etc/sysconfig/iptables file does not exists and needs to be addressed.

1. Run any iptables firewall rule configuration command:

iptables -P OUTPUT ACCEPT
Copy after login

2. Save the iptables service:

service iptables save
Copy after login

3. Restart the iptables service:

service iptables restart
Copy after login

Check the file again.

After that, you can use the following commands to configure certain configurations according to your needs.

sudo vim /etc/sysconfig/iptables
Copy after login

After saving and exiting, using the service iptables start command to start the firewall still fails. The error is: Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service " and "journalctl -xe" for details.

Solution:

After checking, I found that it was because a new file was created for editing when the iptables file did not exist initially, and Saved using service iptables save command.

But after saving, the iptables.save file was generated in the /etc/sysconfig folder. After opening it, I found that it was the same as the iptables I originally created and edited. Then I cleared the iptables.save file and tried it again. service iptables start, the firewall started successfully.

The above is the detailed content of What to do if the firewall fails to be enabled under centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!