博客
关于我
CentOS 7.2:Failed to start IPv4 firewall with iptables
阅读量:418 次
发布时间:2019-03-06

本文共 824 字,大约阅读时间需要 2 分钟。

问题

系统是centos7.2,且已经安装了iptables服务,但是在执行启动命令后,却报了iptables服务无法正常启动的错误。

启动命令如下:

systemctl start iptables.service

报错如下:

Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.

两台服务器都是同样的环境,但是一台一切正常,另一台却是这种情况,觉得有点不对劲,之后尝试了几种其他方式,也试过重装iptables服务和重启服务器的方式,但是依然会报这个错误。

执行journalctl -xe查看错误日志,查到了更加具体的原因,错误如下:

Failed to start IPv4 firewall with iptables.

到这里大概知道问题的原因了。

解决办法

因为centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙。

因为这次报错的服务器是一台刚刚购买的阿里云服务器,所以在操作上忘记关闭默认防火墙的步骤了才导致浪费了些时间在这件事情上。

关闭firewalld:

systemctl stop firewalld  systemctl mask firewalld

使用iptables服务:

#开放443端口(HTTPS)iptables -A INPUT -p tcp --dport 443 -j ACCEPT#保存上述规则service iptables save#开启服务systemctl restart iptables.service

一切正常。

转载地址:http://rvxuz.baihongyu.com/

你可能感兴趣的文章
Zookeeper快速开始
查看>>
882. Reachable Nodes In Subdivided Graph
查看>>
402. Remove K Digits
查看>>
375. Guess Number Higher or Lower II
查看>>
650. 2 Keys Keyboard
查看>>
764. Largest Plus Sign
查看>>
214. Shortest Palindrome
查看>>
916. Word Subsets
查看>>
869. Reordered Power of 2
查看>>
1086 Tree Traversals Again
查看>>
1127 ZigZagging on a Tree
查看>>
1062 Talent and Virtue
查看>>
1045 Favorite Color Stripe
查看>>
B. Spreadsheets(进制转换,数学)
查看>>
等和的分隔子集(DP)
查看>>
基础练习 十六进制转八进制(模拟)
查看>>
L - Large Division (大数, 同余)
查看>>
39. Combination Sum
查看>>
41. First Missing Positive
查看>>
80. Remove Duplicates from Sorted Array II
查看>>