在CentOS7中,有很多CentOS 6中的常用服务发生了变化。

其中iptables是其中比较大的一个。防火墙iptables被firewalld取代。

本文将介绍,如果采用systemctl关闭firewalld,开启iptables。

1.关闭firewalld

[root@hwcentos70- system]# systemctl stop firewalld
[root@hwcentos70- system]# systemctl disable firewalld
[root@hwcentos70- system]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled) Active: inactive (dead) Feb :: hwcentos70- systemd[]: Stopped firewalld - dynamic firewall daemon. Feb :: hwcentos70- systemd[]: Starting firewalld - dynamic firewall daemon... Feb :: hwcentos70- systemd[]: Started firewalld - dynamic firewall daemon. Feb :: hwcentos70- systemd[]: Started firewalld - dynamic firewall daemon. Feb :: hwcentos70- systemd[]: Stopping firewalld - dynamic firewall daemon... Feb :: hwcentos70- systemd[]: Stopped firewalld - dynamic firewall daemon.

2.开启iptables

首先安装iptables:

[root@hwcentos70- system]#yum install -y iptables-services
[root@hwcentos70- system]# systemctl enable iptables
ln -s '/usr/lib/systemd/system/iptables.service' '/etc/systemd/system/basic.target.wants/iptables.service' [root@hwcentos70- system]# systemctl start iptables
[root@hwcentos70- system]# systemctl status iptables
iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled) Active: active (exited) since Fri -- :: UTC; 6s ago Process: ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=/SUCCESS) Main PID: (code=exited, status=/SUCCESS) Feb :: hwcentos70- iptables.init[]: iptables: Applying firewall rules: [ OK ] Feb :: hwcentos70- systemd[]: Started IPv4 firewall with iptables.

此时iptables的命令都可以使用了:

[root@hwcentos70- system]# iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@hwcentos70- system]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

CentOS 7关闭firewalld启用iptables的更多相关文章

  1. CentOS 7关闭firewalld启用iptables 开放端口

    在CentOS7中,有很多CentOS 6中的常用服务发生了变化. 其中iptables是其中比较大的一个.防火墙iptables被firewalld取代. 本文将介绍,如果采用systemctl关闭 ...

  2. centos 7 关闭firewalld开启iptables

    1: 关闭系统高级防火墙firewalld systemctl stop firewalld.service #停止firewall systemctl disable firewalld.servi ...

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

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

  4. Centos7防火墙关闭和启用iptables操作

    https://yq.aliyun.com/ziliao/33590前序 还是docker惹得最近做的系统都是上的centos7的系统带来的一系列的新环境的适应 补记下:在使用oracle vmbox ...

  5. Centos7 防火墙关闭和启用iptables防火墙

    操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭f ...

  6. CentOS 8 关闭 Firewalld 及 SELinux

    检查 SELinux 是否开启 执行 sestatus 指令可以检视目前 SELinux 的状态, 其中一项是是否有开启, 执行以下指令: # sestatus | grep status 如果看到 ...

  7. CentOS 7.0,启用iptables防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止fir ...

  8. (转)CentOS 7.0关闭默认防火墙启用iptables防火墙

    场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...

  9. CentOS 7.0关闭默认防火墙启用iptables防火墙

    转自:https://www.cnblogs.com/lixuwu/p/6087023.html 阅读目录 1 配置防火墙,开启80端口.3306端口 2 关闭SELINUX 3 CentOS 配置防 ...

随机推荐

  1. Python菜鸟之路:Python基础-逼格提升利器:装饰器Decorator

    一.装饰器 装饰器是一个很著名的设计模式,经常被用于有切面需求的场景,较为经典的有插入日志.性能测试.事务处理等. 装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量函数中与函数功能本身 ...

  2. 【题解】国家集训队礼物(Lucas定理)

    [国家集训队]礼物(扩展Lucas定理) 传送门可以直接戳标题 172.40.23.20 24 .1 答案就是一个式子: \[ {n\choose \Sigma_{i=1}^m w}\times\pr ...

  3. Difference Between ZIP and GZIP

    From: http://www.differencebetween.net/technology/difference-between-zip-and-gzip/ Summary: 1. GZIP ...

  4. Spring MVC 通过反射将数据导出到excel

    直接上代码 // 导出excel方法 @RequestMapping("exportExcel") public void exportExcel(HttpServletReque ...

  5. 基于Web的实验室管理系统技术简要报告

    基于Web的实验室管理系统技术简要报告 Copyright 朱向洋 Sunsea ALL Right Reserved 一.网站架构 该网站使用C#语言,利用SQL Server2008数据库,采用V ...

  6. CSS3响应式侧边菜单

    在线演示 本地下载

  7. linux下扩展root分区

    1 查看当前磁盘情况 fdisk -l /dev/sda1 2048 6143 2048 83 Linux /dev/sda2 * 6144 1054719 524288 83 Linux /dev/ ...

  8. Android 蓝牙实例【转】

    本文转自:http://www.yiibai.com/android/android_bluetooth.html 在很多方面,蓝牙是一种能够发送或接受两个不同的设备之间传输的数据. Android平 ...

  9. codeforces 57C 思维

    题意:求出长度为n仅由1到n数字组成的非降序列与非升序列的个数. 思路:转化为求非降序列(非升序列)的个数.n个元素想象为n个离散的点x1,x2,x3,...,xn,在最开头补上一个点x0为1,在最末 ...

  10. LINQ 学习路程 -- 查询语法 LINQ Query Syntax

    1.查询语法 Query Syntax: from <range variable> in <IEnumerable<T> or IQueryable<T> ...