在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. iOS Load方法 和 initialize方法的比较

    一.load方法特点: 1. 当类被引用进程序的时候会执行这个函数 2.一个类的load方法不用写明[super load],父类就会收到调用,并且在子类之前. 3.Category的load也会收到 ...

  2. 开发者眼中的Spring与JavaEE

    JavaEE与Spring 在Java社区中,Spring与Java EE之争是个永恒的话题.在这场争论中,来自两个阵营的布道师.架构师 与铁杆粉丝都在不遗余力地捍卫着本方的尊严,并试图说服对方加入到 ...

  3. Linux里的发消息

    1.给指定用户发送消息 语法: write 用户名 说明: 1.用户是在线的 2.执行过程 a.敲完命令按回车,进入写信模式 b.写信的时候如果写错了Ctrl+退格 删除字符 c.写完以后Ctrl+D ...

  4. Django在不启动server的情况下调用方法

    from django.conf import settingsfrom django import template settings.configure() a = template.Templa ...

  5. python3保存一个网页

    import requests res = requests.get("http://www.baidu.com") savefile = open("baidu.htm ...

  6. c的详细学习(4)选择结构与循环结构的编程练习

        本节介绍c语言的编程实例.     (1)求方程ax^2+bx+0的解: 方程有解有以下几种可能: 1.b^2-4ac=0,方程有两个相等实根. 2.b^2-4ac>0,方程有两个不等实 ...

  7. 创建图形用户界面GUI和事件监听机制的简单实现(java)

    创建图形化界面 1.创建Frame窗体      2.对窗体进行基本设置 比如:大小.位置.布局      3.定义组件      4.将组建通过窗体添加到窗体中 5.让窗体显示,通过setVisib ...

  8. MySQL root 密码重置

    安全模式重置法 基本的思路是,以安全模式启动mysql,这样不需要密码可以直接以root身份登录,然后重设密码. 1. 停止 MySQL 服务 [molo.wu@shark mysql (master ...

  9. http keep-alive简解

    http协议中,客户端发送请求,服务端在接收到请求后,返回所需要的数据后可以关闭连接,这样客户端读取完数据时会返回EOF(-1),表明数据已接受完全 备注:EOF end of file 什么是kee ...

  10. 20145229吴姗珊两天小总结 《Java程序设计》第4周学习总结

    20145229吴姗珊两天小总结 <Java程序设计>第4周学习总结 教材学习内容总结 由于自己的基础不好对知识的理解不透彻,所以这两天的学习还是集中在第六章和第七章,对知识点多了一点理解 ...