zoukankan      html  css  js  c++  java
  • CentOS 7 防火墙设置

    1.查看系统版本

    在设置防火墙的时候,首先查看linux系统版本。

    lsb_release -a
    

    centOS7 系统没有此命令

    cat /etc/redhat-release(/etc/centos-release)
    输出:CentOS Linux release 7.4.1708 (Core) 
    

    此命令对于CentOS6和CentOS7都可以使用。linux系统中etc文件夹主要用于存放一些配置文件。

    2.防火墙相关命令

    启动: systemctl start firewalld
    查看状态: systemctl status firewalld 
    禁止开机启动: systemctl disable firewalld  
    关闭服务: systemctl stop firewalld 关闭
    

    3.systemctl命令

    systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。使用方法如下:

    启动一个服务:systemctl start firewalld.service
    关闭一个服务:systemctl stop firewalld.service
    重启一个服务:systemctl restart firewalld.service
    显示一个服务的状态:systemctl status firewalld.service
    在开机时启用一个服务:systemctl enable firewalld.service
    在开机时禁用一个服务:systemctl disable firewalld.service
    查看服务是否开机启动:systemctl is-enabled firewalld.service
    查看已启动的服务列表:systemctl list-unit-files|grep enabled
    查看启动失败的服务列表:systemctl --failed
    

    注意:CentOS7 以下版本是用iptables为防火墙服务的。

  • 相关阅读:
    Innodb存储引擎
    Innodb学习之MySQL体系结构
    C# sql查询数据库返回单个值方法
    Welcome To SWPUNC-ACM
    P2184 贪婪大陆 题解
    线上Java调优-Arthas入门
    JVM调优学习笔记
    RabbitMQ博文收藏
    System.Net.WebException: 远程服务器返回错误: (405) 不允许的方法。
    随机过程-Brown运动
  • 原文地址:https://www.cnblogs.com/vitasyuan/p/8598377.html
Copyright © 2011-2022 走看看