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 ...
随机推荐
- Windows查看所有的端口及端口对应的程序
步骤一.Windows查看所有的端口 点击电脑左下角的开始,然后选择运行选项,接着我们在弹出的窗口中,输入[cmd]命令,进行命令提示符.然后我们在窗口中输入[netstat -ano]按下回车,即会 ...
- etcd:从应用场景到实现原理的全方位解读
随着CoreOS和Kubernetes等项目在开源社区日益火热,它们项目中都用到的etcd组件作为一个高可用强一致性的服务发现存储仓库,渐 渐为开发人员所关注.在云计算时代,如何让服务快速透明地接入到 ...
- flask的session研究和flask-login的session研究
1.httpie的安装:https://github.com/jakubroztocil/httpie#macos 2.http://python.jobbole.com/87450/ 3.http: ...
- haproxy + rabbitmq + keepalived的高可用环境搭建
一.rabbitmq的搭建:参考rabbimq的安装及集群设置 二.安装和配置haproxy 1.安装haproxyyum install haproxy 2.安装rsysloga. 检查rsyslo ...
- LINQ获取两个List的交集
1.调用: UserList = UserList.ToList().Intersect(userIDList, new MyUserComparer()).AsQueryable(); 2.须要重写 ...
- zabbix agent监控主机配置
zabbix agent监控主机配置 环境说明 系统版本 CentOS 7.2 x86_64 软件版本 zabbix 3.0.18 1.监控zabbix服务器端 1.1 安装zabbi ...
- 转:MVVM的基本入门简介
https://mp.weixin.qq.com/s?__biz=MzA3MjA4NjE3NQ==&mid=404502568&idx=1&sn=fe512f9820b99d3 ...
- 【转载】WEB系统性能问题的分析定位方法
以一个典型的WEB系统来举例,性能问题一般体现在客户端请求后的响应时间上.在性能测试过程中,即压力增大到某个程度后,响应时间指标迅速增长.但如那篇文章所说,这只能叫做一个现象,测试人员需要找到问题所在 ...
- springboot @Configuration
有了@Configuration,原来的springBean的配置文件可以去掉了, 原来在application.xml中配置的bean可以配置在@Configuration注解的来类中,使用@Bea ...
- jQuery 技术揭秘
1.平时jquery调用页: index.html : <!DOCTYPE html> <html lang="en"> <head> < ...