Linux下centOS7系统中无iptables文件报错:"systemctl status iptables.service" and "journalctl -xe" for details.

最近在安装Tomcat时遇到一个问题,启动Tomcat时报错:Job for iptables.service failed because the control process exited with error code. See “systemctl status iptables.service” and “journalctl -xe” for details.

现在我来说一下解决办法:
因为CentOS7版本后开始,默认是没有iptables防火墙的,而是使用firewall防火墙。本文将屏蔽掉firewall,使用iptables

Centos7版本解决方法:

1、首先停止并屏蔽firewalld服务

停止: systemctl stop firewalld
屏蔽 :systemctl mask firewalld

2、安装iptables-service软件包

	yum install iptables-services

3、在引导时启用iptables服务

	systemctl enable iptables

4、启动iptables服务

	systemctl start iptables

5、保存防火墙规则

	service iptables save

再去查看发现已经有了iptables文件

预防:想要改回firewalld防火墙用下面命令

1) 开机自动启动firewalld防火墙

	 systemctl enable firewalld.service

2)关闭开机制动启动

	systemctl disable firewalld.service

3)查看状态

	systemctl status firewalld

4)启用防火墙firewalld

	systemctl start firewalld.service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值