Centos7 关闭防火墙(Firewalld ),使用防火墙(iptables)
1、直接关闭防火墙
systemctl stop firewalld.service; #停止firewall
systemctl disable firewalld.service; #禁止firewall开机启动
2、安装并启动 iptables service,以及设置开机自启
yum -y install iptables-services;#安装iptables
systemctl start iptables;#启动iptables
systemctl enable iptables;#自启动iptables
systemctl start ip6tables;#启动ip6tables(不需要可以跳过)
systemctl enable ip6tables;#自启动ip6tables(不需要可以跳过)
3、配置iptables service
vi /etc/sysconfig/iptables;#如增加防火墙端口3306和一些常用端口 80、8080等
增加规则:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT;
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT;
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT;
保存退出后。
3、重启 iptables service,
systemctl restart iptables.service #重启防火墙使配置生效
4、最后重启系统使设置生效即可
reboot;
Centos7 关闭防火墙(Firewalld ),使用防火墙(iptables)的更多相关文章
- centos7 关闭默认firewalld,开启iptables
编者按: 对于使用了centos6系列系统N年的运维来说,在使用centos7的时候难免会遇到各种不适应.比如防火墙问题.本文主要记录怎么关闭默认的firewalld防火墙,重新启用iptables. ...
- centos7关闭默认firewall,启用iptables
CentOS 7.0默认使用"firewall"防火墙 一:关闭firewall1.直接关闭防火墙systemctl stop firewalld.service 2.禁止fire ...
- CentOS7中关闭firewall,并使用iptables管理防火墙
背景描述 在使用Docker时,启用centos7默认的firewall,启动端口映射时,防火墙规则不生效.docker默认使用了iptables防火墙机制.所以需要关闭firewall使用iptab ...
- CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令
CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...
- CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙
CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48 作者:哎丫丫 来源:哎丫丫数码网 查看:11761 评论:2 ...
- CentOS7关闭默认防火墙启用iptables防火墙
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭firewall: systemctl stop firewalld.service #停止f ...
- CentOS7 防火墙firewalld 和 CentOS6 防火墙iptables 开放zabbix-agent端口的方法
我们在生产环境中,一般都是把防火墙打开的,不像测试环境,可以直接关闭掉.最近安装zabbix ,由于公司服务器既有centos 7又有centos 6,遇到了一些防火墙的问题,现在正好把centos防 ...
- CentOS7.3防火墙firewalld简单配置
今天安装了centos7.3, 想用iptables的save功能保存规则的时候发现跟rhel不一样了, 后来度娘说centos用的是firewalld而不是iptables了, 平时工作都是用re ...
- 如何将centos7自带的firewall防火墙更换为iptables防火墙
用惯了centos6的iptables防火墙,对firewall太无感了,那么如何改回原来熟悉的iptables防火墙呢? 1.关闭firewall防火墙 [root@centos7 html]# s ...
- Centos7 防火墙 firewalld 实用操作
一.前言 Centos7以上的发行版都试自带了firewalld防火墙的,firewalld去带了iptables防火墙.其原因是iptables的防火墙策略是交由内核层面的netfilter网络过滤 ...
随机推荐
- 《Linux及安全》实践3.1
<Linux及安全>实践三 ELF格式文件分析 一.基础操作 1.查看大小端.32还是64 由此可以看出,本人实践所用到的是32位Ubuntu,数据存储采用小端法. 2.编写hello.c ...
- (分享)java向MySQL插入当前时间的四种方式和java时间日期格式化的几种方法(案例说明)
原文地址 http://blog.csdn.net/yangkai_hudong/article/details/18705713
- [功能改进]Live Writer发博支持“建分类、加标签、写摘要”
以前您在园子里用Windows Live Wirter发布博文是不是有以下三个不爽: 不爽1:如果想在发布随笔时新建分类并将随笔添加至该分类,需要先在博客后台添加分类,然后在Live Writer中刷 ...
- 最新版CKEditor在线编辑器的配置方法
下载地址: http://ckeditor.com/download 使用方法: 在页面<head>中引入ckeditor核心文件ckeditor.js <script type=& ...
- Java语言程序设计(基础篇) 第三章 选择
第三章 选择 3.8 计算身体质量指数 package com.chapter3; import java.util.Scanner; public class ComputeAndInterpret ...
- java内存泄漏的定位与分析
1.为什么会发生内存泄漏 java 如何检测内在泄漏呢?我们需要一些工具进行检测,并发现内存泄漏问题,不然很容易发生down机问题. 编写java程序最为方便的地方就是我们不需要管理内存的分配和释放, ...
- Leetcode: Convex Polygon
Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...
- 有一道题,大家能帮我看一下哪里错了吗?c++的
有一道题我不知道是哪里错了,大神们帮忙看一下,谢谢! 试题描述: 在四位自然数中有这样一些特点的数:(1)它们是素数:(2)将这些素数加上45后得到一个新的数值:(3)请同学们在这些新的数值中挑选出: ...
- zzuli-小火山的跳子游戏
Description 小火山和火山火山在一块玩跳子游戏.规则如下: 1:跳子的起始位置为0,棋盘大小从1到N 2:每次跳子跳k步. 例如当前位置为i, 那么下一步为i + k 3:跳 ...
- CSS 盒子
转载自:http://www.zblog.us/programing/web/css/cssbox-introduce-2.html 盒子模型定义 如果CSS对HTML文档元素生成了一个描述该元素在H ...