I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpdservice, but something wrong with my iptables service ... what's wrong with it? What am I doing wrong?

# ifconfig/sbin/service iptables save
bash: ifconfig/sbin/service: No such file or directory # /sbin/service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl. # sudo service iptables status
Redirecting to /bin/systemctl status iptables.service
iptables.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead) # /sbin/service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl. # sudo service iptables start
Redirecting to /bin/systemctl start iptables.service
Failed to issue method call: Unit iptables.service failed to load: No such file or directory.

With RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. IMHO, firewalld is more suited for workstations than for server environments.

It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service:

systemctl stop firewalld
systemctl mask firewalld

Then, install the iptables-services package:

yum install iptables-services

Enable the service at boot-time: IT网,http://www.it.net.cn

systemctl enable iptables

Managing the service

systemctl [stop|start|restart] iptables

Systemctl doesn't seem to manage the save action like you were able to do in the past with service:

/usr/libexec/iptables/iptables.init save  

This fixed it: Linux学习,http:// linux.it.net.cn

yum install iptables-services
systemctl mask firewalld
systemctl enable iptables
systemctl enable ip6tables
systemctl stop firewalld
systemctl start iptables
systemctl start ip6tables

How can i use iptables on centos 7?的更多相关文章

  1. iptables 实现centos内网机器访问外网

    环境:一台带外网和内网的机器,另一台只有内网,默认不能上网.两台机器都是centos系统带外网机器的外网ip为 123.221.20.11, 内网ip为 192.168.15.100内网机器的内网ip ...

  2. How can i use iptables on centos 7 or fedora?

    http://stackoverflow.com/questions/24756240/how-can-i-use-iptables-on-centos-7 # sudo service iptabl ...

  3. 关闭iptables(Centos)

    由于搭建了CDH-Hadoop,方便起见,事先关闭了防火墙: services iptables stop; chkconfig iptables off; services ip6tables st ...

  4. 玩转Linux之- CentOS 7.0,启用iptables防火墙

    原文 玩转Linux之- CentOS 7.0,启用iptables防火墙 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall:sy ...

  5. Centos 7 docker 启动容器 iptables 报 No chain/target/match by that name

    我也遇到这个问题,原因时启动docker服务时没有启动iptables服务导致的(有些docker需要再iptables开放有些端口)解决方法1.启动iptables服务 CentOS 7 以下版本 ...

  6. CentOS iptables防火墙的基本应用讲解

    iptables是Linux下不错的防火墙软件,本文主要给大家介绍下iptables的安装.规则增加和清除.开放指定端口.屏蔽指定ip和ip段等CentOS下iptables的基本应用. 一.ipta ...

  7. CentOS下配置iptables防火墙 linux NAT(iptables)配置

    CentOS下配置防火墙 配置nat转发服务CentOS下配置iptables防火墙 linux NAT(iptables)配置 CentOS下配置iptables 1,vim /etc/syscon ...

  8. Centos 上 Tengine安装

    安装步骤: 1.系统环境 1.1 更新系统 [root@centos ~]# yum update -y 1.2 查看环境 [root@centos ~]# cat /etc/redhat-relea ...

  9. Greenplum 源码安装教程 —— 以 CentOS 平台为例

    Greenplum 源码安装教程 作者:Arthur_Qin 禾众 Greenplum 主体以及orca ( 新一代优化器 ) 的代码以可以从 Github 上下载.如果不打算查看代码,想下载编译好的 ...

随机推荐

  1. Hibernate 二级缓存疑难点

    一级缓存:缓存实体 二级缓存:缓存实体 Hibernate查询缓存缓存的是查询出来的实体的部分属性结果集和实体的ID(注意这里不是实体). Hibernate查询缓存:对List起作用.但是Hiber ...

  2. webpack2.0学习

    1.进到指定的目录下,新建自己的文件名 mkdir webpack-test 创建你的项目名称或者你己有的项目名称cd webpack-test npm initnpm install webpack ...

  3. Ibatis.Net 执行存储过程学习(八)

    首先在数据库创建存储过程: create proc [dbo].[usp_GetPersonById] @Id int as begin select Id,Name from Person wher ...

  4. MySQL的聚集索引和非聚集索引

    一. MYSQL的索引 mysql中,不同的存储引擎对索引的实现方式不同,大致说下MyISAM和InnoDB两种存储引擎. MyISAM的B+Tree的叶子节点上的data,并不是数据本身,而是数据存 ...

  5. wfst的compose算法

    介绍一些compose算法,以及这部分的代码实现. 原理部分参考: 走进语音识别中的 WFST(二) 可以看下示例图: 我们先来看一下 Composition 的效果,图(a)和图(b)Composi ...

  6. koa+orm2

    koa+orm2 koa是由 Express 原班人马打造的新的web框架.套用其官方的说法:Koa 应用是一个包含一系列中间件 generator 函数的对象. 这些中间件函数基于 request ...

  7. MaximumClique HDU1530

    最大团问题入门题 最基础的方法是dfs 参考: 首先,我们先得到后几个点组成的最大团到底是多大,(最开始的时候肯定是最后一个点单独构成一个最大团,点数为1)然后我们再 DFS: 初始化: 从一个点 u ...

  8. WIN10下使用Anaconda配置opencv、tensorflow、pygame并在pycharm中运用

    昨天想运行一段机器学习的代码,在win10系统下配置了一天的python环境,真的是头疼,准备写篇博客来帮助后面需要配置环境的兄弟. 1.下载Anaconda 根据昨天的经历,发现Anaconda真的 ...

  9. 浅析Entity FrameWork性能优化

    浅析EF性能优化 1.       数据Load 延迟加载:当实体第一次读取时,相关数据没有加载:当第一次试图访问导航属性时,所需的导航数据自动加载,EF默认使用这种方式加载数据,尽量使用预先加载和显 ...

  10. EntityFramework笔记

    参照文档:http://www.cnblogs.com/farb/p/ABPAdvancedTheoryContent.html 案例:http://pan.baidu.com/s/1c1Qgg28 ...