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. 大数据系列之数据仓库Hive安装

    Hive系列博文,持续更新~~~ 大数据系列之数据仓库Hive原理 大数据系列之数据仓库Hive安装 大数据系列之数据仓库Hive中分区Partition如何使用 大数据系列之数据仓库Hive命令使用 ...

  2. 在SharePoint 2013里配置Excel Services

    配置步骤,请参看下面两篇文章 http://www.cnblogs.com/jianyus/p/3326304.html https://technet.microsoft.com/zh-cn/lib ...

  3. linux终端自定义设置

    2014年1月4日 19:21:16 1. ls命令显示文件列表时不再花花绿绿 vi ~/.bashrc alias ls='ls -a --color=never' alias ll='ls -lh ...

  4. fastdfs:安装nginx

    #安装依赖 yum -y install gcc yum -y install gcc-c++ yum -y install zlib-devel yum -y install pcre-devel ...

  5. MongoDB:数据导入CSV文件之错误记录

    测试主机1:Windows 10,MongoDB 3.6.3,WPS 10.1,Notepad++ 7.5.3, 测试主机2:Ubuntu 16.04,MongoDB 4, 今天测试了将数据从文件—— ...

  6. 文件时间戳修改touch和查看stat和ls --time

    查看文件时间戳命令:stat awk.txtFile: `awk.txt'Size: 20  Blocks: 8  IO Block: 4096  regular fileDevice: 801h/2 ...

  7. tenaorflow函数(1)

    TensorFlow 将图形定义转换成分布式执行的操作, 以充分利用可用的计算资源(如 CPU 或 GPU.一般你不需要显式指定使用 CPU 还是 GPU, TensorFlow 能自动检测.如果检测 ...

  8. InnoDB master thread工作原理

    我们简单交流下InnoDB master thread学习,有兴趣的朋友可以参考<<MySQL技术内蒙--InnoDB存储引擎第二版>> void master_thread( ...

  9. 【LOJ】#2269. 「SDOI2017」切树游戏

    题解 把所有的数组一开始就FWT好然后再IFWT回去可以减小常数 从13s跑到0.7s-- 可以参照immortalCO的论文,感受一下毒瘤的动态动态DP 就是用数据结构维护线性递推的矩阵的乘积 由于 ...

  10. MapReduce实战1

    MapReduce编程规范: (1)用户编写的程序分成三个部分:Mapper,Reducer,Driver(提交运行mr程序的客户端) (2)Mapper的输入数据是KV对的形式(KV的类型可自定义) ...