一、配置防火墙,开启80端口、3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT Linux学习,http:// linux.it.net.cn -A INPUT -p icmp -j ACCEPT Linux学习,http:// linux.it.net.cn -A INPUT -i lo -j ACCEPT IT网,http://www.it.net.cn -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT IT网,http://www.it.net.cn -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
:wq! #保存退出
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
二、关闭SELINUX
vi /etc/selinux/config Linux学习,http:// linux.it.net.cn #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 Linux学习,http:// linux.it.net.cn SELINUX=disabled #增加
:wq! #保存退出
setenforce 0 #使配置立即生效 |
- 浏览: 378930 次
最新评论
-
Aceslup:
非常感谢你提供的jars。
在Apache Tomcat 7设置redis作为session store -
Aceslup:
tomcat启动是没报错,不过,session无法保存到red ...
在Apache Tomcat 7设置redis作为session store -
pyzheng:
我也是这样配置了, 但是配置 <Valve class ...
在Apache Tomcat 7设置redis作为session store -
shiguanghui:
我检测到这个redis访问不正常。我肯定会停掉keepaliv ...
Redis双机热备(keepalived实现) -
ctfyforever:
非常感谢你的贡献,但是我发现个错误chk_redis.sh 脚 ...
Redis双机热备(keepalived实现)
相关推荐
CentOS 7关闭防火墙(firewall)并安装iptables防火墙.docx
关闭SElinux、配置防火墙 1、vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq! #保存退出 setenforce 0 #使配置立即生效 2、vi /etc/sysconfig/...
关于CentOS7下Firewall防火墙配置用法可以通过这篇文章进行查看,下面来看看本文的主要内容关于centos 7中firewall防火墙的常用命令,需要的朋友们可以参考学习。 一、开启、关闭firewall 启动: systemctl start ...
虽说阿里云推出了云盾服务,但是自己再加一层防火墙总归是更安全些,下面是我在阿里云vps上配置防火墙的过程,目前只配置INPUT。OUTPUT和FORWORD都是ACCEPT的规则 一、检查iptables服务状态 首先检查iptables服务的...
防火墙白名单设置方法_iptables_centos6 防火墙白名单设置方法_iptables_centos6 防火墙白名单设置方法_iptables_centos6
该文档详细介绍了Redhat7支持的iptables服务与firewalld服务,并将iptables服务的命令行实例做了完整演示。
centos7下firewall配置谅解,不用IPtables的自己看看这个个吧,centos7换成这个了
CentOS 7 中firewall-cmd命令 在 CentOS 7 暂时开放 ftp 服务 # firewall-cmd –add-service=ftp 永久开放 ftp 服务 # firewall-cmd –add-service=ftp –permanent 永久关闭 # firewall-cmd –remove-service=ftp...
centos 7中防火墙是一个非常的强大的功能了,但对于centos 7中在防火墙中进行了升级了,下面我们一起来详细的看看关于centos 7中防火墙使用方法。 FirewallD 提供了支持网络/防火墙区域(zone)定义网络链接以及接口...
由于docker在执行此命令时,是向iptables注入了一条规则将主机803映射到容器80端口,但是CentOS 7中以firewalld服务替代了iptables。因此,上述命令的端口映射不会生效。 解决方法:首先观察一下主机上的网卡信息,...
centos 7 防火墙命令,firewall+iptables..........................................................................................................................................
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2、安装...
CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2、安装...
在Hadoop安装过程中需要关闭 防火墙和SElinux 及其配置文件设置
在安装tomcat的时候最后出现了需要开放8080端口,发现默认的Centos7并没有iptables文件,这里我来说下这种情况怎么办; 因为Centos7默认使用的是firewall作为防火墙,把它停掉再安装iptable 命令如下: 【修改后...
查看centos7的官方文档,知道centos7最小安装默认只安装防火墙的动态配置规则服务(firewalld),静态配置规则服务(iptables与ip6tables)需要另行安装。 1、关闭firewall: systemctl stop firewalld.service #...
CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2、安装...
ansible-role-firewall:Ansible角色-iptables防火墙配置
学习apache安装的时候需要打开80端口,由于centos 7版本以后默认使用firewalld后,网上关于iptables的设置方法已经不管用了,想着反正iptable也不太熟悉,索性直接搬官方文档,学习firewalld了,好像比iptables要...