RHEL 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。

关闭firewall:

  1. systemctl stop firewalld.service #停止firewall
  2. systemctl disable firewalld.service #禁止firewall开机启动
  3. yum install iptables-services  #安装iptables
  4. vi /etc/sysconfig/iptables  #编辑防火墙配置文件
  5. # Firewall configuration written by system-config-firewall
  6. # Manual customization of this file is not recommended.
  7. *filter
  8. :INPUT ACCEPT [0:0]
  9. :FORWARD ACCEPT [0:0]
  10. :OUTPUT ACCEPT [0:0]
  11. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  12. -A INPUT -p icmp -j ACCEPT
  13. -A INPUT -i lo -j ACCEPT
  14. -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
  15. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
  16. -A INPUT -j REJECT --reject-with icmp-host-prohibited
  17. -A FORWARD -j REJECT --reject-with icmp-host-prohibited
  18. COMMIT
  19. :wq! #保存退出

  • systemctl  start  iptables.service  #启动防火墙
  • systemctl  stop  iptables.service  #停止防火墙
  • systemctl  restart  iptables.service  #重启防火墙
  • systemctl  status  iptables.service  #查看防火墙状态
  • systemctl  enable  iptables.service  #设置开机启动

RHEL 7.0 修改防火墙配置的更多相关文章

  1. CentOSv6.8 修改防火墙配置、修改SSH端口

    查看防火墙目前使用状况: service iptables status 修改防火墙配置: vi /etc/sysconfig/iptables 重启防火墙,让刚才修改的配置生效: service i ...

  2. CentOS 7.0 Firewall防火墙配置

    启动停止 获取firewall状态 systemctl status firewalld.service firewall-cmd --state 开启停止防火墙 开机启动:systemctl ena ...

  3. Linux系统修改防火墙配置

    防火墙配置文件位置 /etc/sysconfig/iptables 需要开放端口,请在里面添加一条内容即可: 1 -A RH-Firewall-1-INPUT -m state --state NEW ...

  4. Centos7.0关闭防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.service #关闭firew ...

  5. RHEL 7.0 本地配置yum源

    RHEL 7.0 本地配置yum源  yum简介  yum = Yellow dog Updater, Modified 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它 ...

  6. 网卡配置和DNS配置,手动挂在nas存储的共享目录,网络相关其它操作命令,修改防火墙中的端口配置,resolv.conf配置详细介绍和网卡信息配置详细介绍

    1.   网卡配置和DNS配置 若想服务器能够发邮件,需要让部署的服务器能够访问到外网环境.若部署的服务器访问不到外网,通过ping www.baidu.com的方式执行的时候,会出现以下问题: &q ...

  7. WCF 4.0 如何编程修改wcf配置,不使用web.config静态配置

    How to programmatically modify WCF without web.config setting WCF 4.0 如何编程修改wcf配置,不使用web.config静态配置 ...

  8. 烂泥:zabbix3.0安装与配置

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 这个月又快过完了,最近也比较忙,没时间写文章,今天挤点时间把zabbix3.0安装与配置 ...

  9. Linux防火墙配置(iptables, firewalld)

    netfilter和底层实现 iptables firealld Linux中的防火墙 RHEL中有几种防火墙共存: iptables firewalld ip6tables ebtables 这些软 ...

随机推荐

  1. AFNetworking 使用 核心代码

    ///////////////////////////以前用法///////////////////////////////////////////////////////////// //使用AFH ...

  2. CloudStack核心类ApiServlet、ApiServer、ApiDispatcher、GenericDaoBase源码分析

    ApiServlet 首先从整体上看下ApiServlet,Outline视图如下, 一.注意@Inject依赖的是javax.inject.jar,它和spring的@Autowired的区别在于使 ...

  3. C++11 new feature

    C++11 在类中引入了Move Constructor and the Move Assignmnt Operaetor,所谓‘move’指的是在复制对象时,left object 不用再创建资源, ...

  4. 《Programming WPF》翻译 第7章 2.图形

    原文:<Programming WPF>翻译 第7章 2.图形 图形时绘图的基础,代表用户界面树的元素.WPF支持多种不同的形状,并为它们每一个都提供了元素类型. 7.2.1基本图形类 在 ...

  5. php-timeit估计php函数的执行时间

    首先,前段时间利用手头的日本VPS搭建了一个google代理,访问速度还行,分享给大家: 谷歌 谷歌:guge119.com 谷歌学术:scholar.guge119.com 有时候我们在PHP性能优 ...

  6. hdu 1561 The more, The Better_树状dp

    题目链接 题意:给你一棵树,各个节点都有价值(除根节点),从根节点出发,选择m个节点,问最多的价值是多小. 思路:很明显是树状dp,遍历树时背包最优价值,dp[i][k]=max{dp[i][r]+d ...

  7. 0,null,empty,空,false,isset

    <?php header("Content-type: text/html; charset=utf-8"); $a=0; //1. if($a==0) { echo $a; ...

  8. qt视图选择

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.Qt import * from PyQt4. ...

  9. IOS UIImage 模糊

    #import <UIKit/UIKit.h> #import <Accelerate/Accelerate.h> #import <QuartzCore/QuartzC ...

  10. python学习之路-13

    SQLAlchemy ORM框架 连表操作 一对多 创建表 指定约束 ForeignKey from sqlalchemy import create_engine from sqlalchemy.e ...