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)的更多相关文章

  1. centos7 关闭默认firewalld,开启iptables

    编者按: 对于使用了centos6系列系统N年的运维来说,在使用centos7的时候难免会遇到各种不适应.比如防火墙问题.本文主要记录怎么关闭默认的firewalld防火墙,重新启用iptables. ...

  2. centos7关闭默认firewall,启用iptables

    CentOS 7.0默认使用"firewall"防火墙 一:关闭firewall1.直接关闭防火墙systemctl stop firewalld.service 2.禁止fire ...

  3. CentOS7中关闭firewall,并使用iptables管理防火墙

    背景描述 在使用Docker时,启用centos7默认的firewall,启动端口映射时,防火墙规则不生效.docker默认使用了iptables防火墙机制.所以需要关闭firewall使用iptab ...

  4. CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令

    CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...

  5. CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙

    CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48  作者:哎丫丫  来源:哎丫丫数码网  查看:11761  评论:2 ...

  6. CentOS7关闭默认防火墙启用iptables防火墙

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

  7. CentOS7 防火墙firewalld 和 CentOS6 防火墙iptables 开放zabbix-agent端口的方法

    我们在生产环境中,一般都是把防火墙打开的,不像测试环境,可以直接关闭掉.最近安装zabbix ,由于公司服务器既有centos 7又有centos 6,遇到了一些防火墙的问题,现在正好把centos防 ...

  8. CentOS7.3防火墙firewalld简单配置

    今天安装了centos7.3, 想用iptables的save功能保存规则的时候发现跟rhel不一样了,  后来度娘说centos用的是firewalld而不是iptables了, 平时工作都是用re ...

  9. 如何将centos7自带的firewall防火墙更换为iptables防火墙

    用惯了centos6的iptables防火墙,对firewall太无感了,那么如何改回原来熟悉的iptables防火墙呢? 1.关闭firewall防火墙 [root@centos7 html]# s ...

  10. Centos7 防火墙 firewalld 实用操作

    一.前言 Centos7以上的发行版都试自带了firewalld防火墙的,firewalld去带了iptables防火墙.其原因是iptables的防火墙策略是交由内核层面的netfilter网络过滤 ...

随机推荐

  1. oracle从零开始学习笔记 三

    高级查询 随机返回5条记录 select * from (select ename,job from emp order by dbms_random.value())where rownum< ...

  2. SSR———团队作业:小型论坛的设计与初步实现

    小型论坛的设计与初步实现 这次团队作业,我们设计的是一个小型论坛,作为团队中的一员,我主要负责对用户进行需求调研与对用户体验的过程拍摄总结,力求我们的项目在力所能及的范围内更加完美 视频:   度盘链 ...

  3. git-credential-winstore.exe": No such file or directory

    $ git push -u origin master\"D:/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe ...

  4. 如何理解泛型中的new()约束

    一:为什么需要New约束 假设有这样一个需求,它需要在定义一个泛型类时同时实例化T对象.有网友说了:"这还不简单,我立刻给你写一个",刷刷刷,得到以下的例子. public cla ...

  5. 【转载】Mysql 查看连接数,状态

    转载地址:http://blog.csdn.net/starnight_cbj/article/details/4492555 命令: show processlist; 如果是root帐号,你能看到 ...

  6. vim - line

    copy complete current line: yy replace a char (e.g. comma) to new line: %s/,/\r/g

  7. LVM 'Can’t open /dev/sdb1 exclusively. Mounted filesystem?' Problem

    服务器做mysql时候,添加的新磁盘做lvm时候,创建物理卷报错 saltstack_s:/proc/scsi # cat /proc/partitions major minor #blocks n ...

  8. Leetcode: Design Snake Game

    Design a Snake game that is played on a device with screen size = width x height. Play the game onli ...

  9. scott/tiger登录时提醒ora-28000 the account is locked

    scott/tiger登录时提示ora-28000 the account is locked在plsql developer中要是以scott/tiger登录时提示ora-28000 the acc ...

  10. sed

    命令行格式为:         sed [-nefri]  ‘command’  输入文本/文件 常用选项:        -n∶取消默认的输出,使用安静(silent)模式.在一般 sed 的用法中 ...