美文网首页Linux
Centous7 防火墙使用命令

Centous7 防火墙使用命令

作者: 开心的小娇 | 来源:发表于2018-12-27 16:37 被阅读78次

1、firewalld的基本使用

查看防火墙状态:        systemctl  status    firewalld    

停止防火墙服务 :         systemctl  stop      firewalld    

开启防火墙服务:         systemctl  start      firewalld    

 禁止防火墙开机启动 :syntemctl  disable firewalld  

开启防火墙开机启动: systemctl  enable  firewalld  

2.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

3.配置firewalld-cmd

查看版本: firewall-cmd --version

查看帮助: firewall-cmd --help

显示状态: firewall-cmd --state

查看所有打开的端口: firewall-cmd --zone=public --list-ports

更新防火墙规则: firewall-cmd --reload

查看区域信息:  firewall-cmd --get-active-zones

查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0

拒绝所有包:firewall-cmd --panic-on

取消拒绝状态: firewall-cmd --panic-off

查看是否拒绝: firewall-cmd --query-panic

4.开启一个端口呢

添加

firewall-cmd--zone=public--add-port=80/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)

重新载入

firewall-cmd --reload

查看

firewall-cmd--zone=public--query-port=80/tcp

删除

firewall-cmd--zone=public--remove-port=80/tcp --permanent

相关文章

  • Centous7 防火墙使用命令

    1、firewalld的基本使用 查看防火墙状态:systemctl status firewalld 停止防...

  • linux防火墙

    关闭防火墙 使用如下命令关闭防火墙 使用如下命令关闭防火墙开机自启动 此时查看防火墙状态即可 如果显示not ru...

  • Linux 防火墙firewall设置

    Linux 防火墙设置说明:使用的是FIREWALL防火墙 安装防火墙 开启防火墙 排除端口 命令含义: 防火墙重...

  • iptables的简单使用总结

    iptables使用 使用iptables命令设置防火墙规则时,其基本的命令格式如下: iptables [ -t...

  • centos7防火墙基本命令

    防火墙的基本使用命令 启动防火墙 停止防火墙 开机启动防火墙 开机禁止防火墙 查看防火墙状态 查看防火墙是否开机启...

  • linux 关闭防火墙

    CentOS6关闭防火墙使用以下命令, service iptable status 查看防火墙状态 servci...

  • firewall防火墙配置命令合集(centos7)

    本合集整理所有firewall防火墙配置相关的命令,在使用firewall防火墙过程中,不常用的命令要搜索好久才找...

  • 使用DOC命令采集windows防火墙状态

    当前使用命令 防火墙状态:netsh firewall show state可以得到防火墙当前状态 拓展 可以通过...

  • linux基础优化

    linux优化 1.基础 关闭防火墙 Selinux 获取防火墙状态 关闭selinux 使用命令 getenfo...

  • CentOS 7 开放防火墙端口命令

    CentOS 7 开放防火墙端口 命令 使用方法如下: 关闭防火墙 开启端口firewall-cmd --zone...

网友评论

    本文标题:Centous7 防火墙使用命令

    本文链接:https://www.haomeiwen.com/subject/pfqdlqtx.html