在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. 我的Android进阶之旅------>Android之动画之Frame Animation实例

    ============================首先看看官网上关于Frame animation的介绍================================ 地址:http://de ...

  2. IE下获取不到Response添加的cookie的解决方法

    原博客地址: http://blog.csdn.net/wjdd1/article/details/16341189 在百度上查询了好久也没有查询到结果,于是自己用ie的开发者工具进行跟踪,JSESS ...

  3. activiti基础--2----------------------(流程定义)

    Deployment 部署对象 1.一次部署的多个文件信息,对于不需要的流程可以删除和修改 2.对应的表 act_re_deployment #部署对象表 act_re_procdef #流程定义表 ...

  4. ubuntu14.04下svn版本管理系统的安装及常用命令的使用整理

    ubuntu14.04下安装svn$sudo apt-get install subversion 执行这一步就安装完成了,在ubuntu先安装很方便 安装完成后,创建版本库目录,由于是本地环境,就在 ...

  5. 【leetcode刷题笔记】Substring with Concatenation of All Words

    You are given a string, S, and a list of words, L, that are all of the same length. Find all startin ...

  6. 【leetcode刷题笔记】Largest Rectangle in Histogram

    Given n non-negative integers representing the histogram's bar height where the width of each bar is ...

  7. 【leetcode刷题笔记】Insertion Sort List

    Sort a linked list using insertion sort. 题解:实现链表的插入排序. 要注意的地方就是,处理链表插入的时候尽量往当前游标的后面插入,而不要往前面插入,后者非常麻 ...

  8. 前端绘图方式Canvas和SVG的区别

    Canvas和SVG是html5中支持2种可视化技术,都是可以在画布上绘制图形和放入图片.下面来介绍和分析一下他们. 一.Canvas 和 SVG 简介 1.什么是Canvas? Canvas 是H5 ...

  9. 现有exe转为服务_方式01

    1.安装X.exe服务: ...>路径\X.exe /install 2.卸载X.exe服务: ...>路径\X.exe /uninstall 3.开始运行XX(程序是X.exe,服务名是 ...

  10. Java集合类--->入门上篇

    最近我又在研究Java语言,这是第五次还是第六次学习Java的集合类,你也许会惊讶为什么这么多次?哈哈,因为之前的我没有记录下来,忘记了,当然最主要还是觉得自己毅力不够,没有坚持.那么,这次我将换一种 ...