zoukankan      html  css  js  c++  java
  • RHEL 7.0 修改防火墙配置

    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  #设置开机启动
  • 相关阅读:
    浅谈px,em和rem这些单位的区别
    nodejs中的formidable模块
    es6中的Symbol.iterator属性
    jQuery源码解析----内部插入的外部函数
    关于js函数中存在异步的情况下的变量的分析
    jQuery源码解析----模拟核心buildFragment
    jQuery源码解析----模拟html()、text()、val()
    Config
    Zuul
    Hystrix
  • 原文地址:https://www.cnblogs.com/dai330713/p/4938847.html
Copyright © 2011-2022 走看看