centos7.0 关闭防火墙
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
2、iptables防火墙(这里iptables已经安装,下面进行配置)
vi/etc/sysconfig/iptables #编辑防火墙配置文件
# sampleconfiguration for iptables service
# you can edit thismanually or use system-config-firewall
# please do not askus to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT[0:0]
:OUTPUT ACCEPT[0:0]
-A INPUT -m state--state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -jACCEPT
-A INPUT -i lo -jACCEPT
-A INPUT -p tcp -mstate --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080-j ACCEPT
-A INPUT -j REJECT--reject-with icmp-host-prohibited
-A FORWARD -jREJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出
备注:这里使用80和8080端口为例。***部分一般添加到“-A INPUT -p tcp -m state --state NEW -m tcp--dport 22 -j ACCEPT”行的上面或者下面,切记不要添加到最后一行,否则防火墙重启后不生效。
systemctlrestart iptables.service #最后重启防火墙使配置生效
systemctlenable iptables.service #设置防火墙开机启动
centos7.0 关闭防火墙的更多相关文章
- Centos7.0关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.service #关闭firew ...
- CentOS7/6 关闭防火墙
CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...
- Centos7永久关闭防火墙
Centos7永久关闭防火墙 查看防火墙状态: systemctl status firewalld.service 绿的running表示防火墙开启 执行关闭命令: systemctl stop f ...
- Centos7设置关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下. 1.关闭防火墙 [root@localhost ~]# systemctl stop firew ...
- centos7上关闭防火墙
centos7上默认开启的是+firewalld,关闭了iptables 停止防护墙: systemctl stop firewalld.service 开机不启动: systemctl disabl ...
- centOS7.0配置防火墙
之前用的iptables来管理的防火墙,后来发现centOS7.0中已经用firewalld取代iptables了,于是与时俱进,停用了iptables. systemctl stop iptable ...
- centos7上面关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙:若没有启用iptables 作为防火墙,则使用以下方式关闭防火墙: systemctl stop firewalld.service 关闭开 ...
- 【Linux】CentOS7 打开关闭防火墙及端口
一.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld1.firewalld的基本使用启动: systemctl start firewalld查状态:syst ...
- 003 centos7中关闭防火墙
在centos7中,防火墙有了新的变化.下面是常用的几个命令. 1.查看状态 systemctl status firewalld 2.关闭防火墙 systemctl stop firewalld.s ...
随机推荐
- 设计模式之原型模式(php实现)
github地址:https://github.com/ZQCard/design_pattern1.先了解什么是浅拷贝与深拷贝 //深拷贝:赋值时值完全复制,完全的copy,对其中一个作出改变,不会 ...
- 使apache的日志文件里不记录图片文件
找到: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-A ...
- eclipse进行Debug的时候,发出“java breakpoint unable to install breakpoint”错误
错误情况图: 问题的解决方法: 直接点击忽略掉:Don't tell me again 来自网上的答案~~ I had the same error message in Eclipse 3.4.1, ...
- 机器学习&深度学习资料(转载)
转自 飞鸟各投林 <Brief History of Machine Learning> 介绍:这是一篇介绍机器学习历史的文章,介绍很全面,从感知机.神经网络.决策树.SVM.Adaboo ...
- 设置textField的placegolder的字体大小和字体颜色
由于项目的主题颜色为灰黑色,所以当使用textField的时候,placeholder内的字体默认是灰色,当程序执行的时候,差点儿看不到. 翻来翻去找到一种比較简单地方法, ...
- zabbix自定义监控项一
1.在agent端配置 1.1 添加自定义监控项 zabbix中监控项叫做item,监控项的取值方法叫做key item: Items是从agnet主机里面获取的所有数据.通常情况下我叫itme为监控 ...
- 转: Linux 上的常用文件传输方式介绍与比较
from: https://www.ibm.com/developerworks/cn/linux/l-cn-filetransfer/ ftp ftp 命令使用文件传输协议(File Transf ...
- WordPress安全检测工具
Wordpres是一款非常流行cms系统,市面上有相当一部分的博客和站点都是使用wordpress搭建.正因为大多博客都使用wordpress,所以其安全性就显得尤为重要. 我们平时维护一个站点(不仅 ...
- sql NextResult()多个结果集
转自 http://blog.csdn.net/limlimlim/article/details/8626898 注意:当SQL语句中出现两条Select语句,例如:string sql = &q ...
- 标准库Allocator(三)uninitialized_fill等函数的实现
前面我们使用了uninitialized_fill,来批量初始化某一段内存. 下面提供三个函数的实现代码,这三个代码的共同点是: 1.遇到错误,抛出异常 2.出现异常时,把之前构造的对象全部销毁 所以 ...