zoukankan      html  css  js  c++  java
  • CentOS7防火墙(firewall)配置

    1、Centos7和Centos6 防火墙的区别:

        使用的工具不一样了。Centos6 使用的是iptables ,Centos7 使用的是filewall

        iptables 用于过滤数据包,属于网络层防火墙。

        firewall 能够允许哪些服务可用,那些端口可用...属于更高一层的防火墙。

    2、开启、重启、关闭、查看firewalld.service服务状态

    systemctl start firewalld 开启
    
    systemctl  restart firewalld 重启
    
    systemctl stop firewalld  关闭
    
    systemctl  disable firewalld  关闭开机启动
    
    systemctl status firewalld  查看firewall服务状态

    3、查看firewall的状态

    firewall-cmd --state

    4、查看防火墙规则

    firewall-cmd --list-all 

    5、查询、开放、关闭端口

    # 查询端口是否开放
    firewall-cmd --query-port=8080/tcp
    # 开放80端口
    firewall-cmd --permanent --add-port=80/tcp
    # 移除端口
    firewall-cmd --permanent --remove-port=8080/tcp #重启防火墙(修改配置后要重启防火墙)firewall-cmd --reload # 参数解释 1、firwall-cmd:是Linux提供的操作firewall的一个工具; 2、--permanent:表示设置为持久; 3、--add-port:标识添加的端口;

    6、firewall 配置

    The configuration for firewalld is stored in various XML files

        in /usr/lib/firewalld and /etc/firewalld

    注意:以下firewalld 的操作只有重启之后才有效:systemctl firewalld restart 

    1)系统配置目录

            /usr/lib/firewalld/services

        目录中存放定义好的网络服务和端口参数,系统参数,不能修改

     2)用户配置目录

        /etc/firewalld/

  • 相关阅读:
    python 学习分享-进程
    python 学习分享-实战篇类 Fabric 主机管理程序开发
    python 学习分享-线程
    python 学习分享-paramiko模块
    linux ubuntu开启sshd
    python 学习分享-实战篇高级的ftp
    python 学习分享-socketserver
    python 学习分享-socket编程
    Java学习笔记--Java开发坏境搭建
    C# 泛型
  • 原文地址:https://www.cnblogs.com/uestc2007/p/14500163.html
Copyright © 2011-2022 走看看