centos6.8启动防火墙失败解决方案

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lyj434786736lyj/article/details/81915124

我是centos6.8的系统,在配置vsftpd的过程中,需要进行防火墙的配置,这时候遇到了问题。

一、首先我的/etc/sysconfig/iptables这个文件并不存在,需要解决这个问题。

1.任意运行一条iptables防火墙规则配置命令: 

iptables -P OUTPUT ACCEPT 


2.对iptables服务进行保存: 

service iptables save  


3.重启iptables服务:

service iptables restart

再查看文件有了。

而后你可以通过sudo vim /etc/sysconfig/iptables命令按照你的需要进行一定的配置。保存退出以后,使用service   iptables start命令启动防火墙发现仍然失败,报错为:Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.

经过查看,发现是因为在最初iptables文件不存在的时候新建了一个该文件进行编辑,并且使用service   iptables save命令进行了保存。保存后在/etc/sysconfig文件夹下生成了iptables.save文件,打开后发现与我最初新建的iptables并进行编辑的内容相同,而后我将iptables.save 文件清空,再次service   iptables start,防火墙启动成功。

猜你喜欢

转载自blog.csdn.net/lyj434786736lyj/article/details/81915124
今日推荐