`

firewalld的基本使用

 
阅读更多

1、firewalld的基本使用

启动: systemctl start firewalld

查看状态: systemctl status firewalld 

停止: systemctl disable firewalld

禁用: systemctl stop 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

 

那怎么开启一个端口呢

添加

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

分享到:
评论

相关推荐

    防火墙白名单设置方法_firewalld_centos7.pdf

    为firewall设置访问白名单,仅允许合法的ip访问特定端口,如下以9089端口以及5672端口为例

    Linux防火墙-firewalld

    1、基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2、Centos7操作 1、启动一个服务 systemctl start...

    详解CentOS7使用firewalld打开关闭防火墙与端口

    1、firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld  2.systemctl是CentOS7的服务管理...

    linux端口开放方法

    firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 : systemctl enable ...

    linux之centos7防火墙基本使用详解

    1、firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具...

    firewall-cmd命令.txt

    也可以直接编辑XML文件(官方不建议使用些方法)。 4、frewall-cmd创建防火墙规则分基本规则与富规则(Rich Language)。 区别在于:基本规则不能指定源、目IP,不能指定IP协议版本。控制范围较宽,在某些需要精准...

    CentOS7打开关闭防火墙与端口

    CentOS7 打开关闭防火墙与端口 1、firewalld的基本使用 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

    javashuffle源码-cfg-note:Linux系统常用配置笔记,非项目,包含网络、基本工具、环境变量、Jdk、Scala、Tomca

    (本人使用的是7,推荐安装Minimal版,不使用系统自带工具,全部自己安装) 虚拟机软件(仅针对在Windows/Mac操作系统下学习CentOS,否则略过此项) (推荐使用开源软件,并且本文仅针对此虚拟机) 二、系统篇 ...

    Linux常用(实用)命令大全

    1、cd命令:这是一个非常基本,也是大家经常需要使用的命令,它用于切换当前目录,它的参数是要切换到的目录的路径,可以是绝对路径,也可以是相对路径。如: cd /home 进入根目录下面的home目录 cd home 进入当前...

    【Linux】CentOS7防火墙开启、停止、关闭,添加删除开放端口

    文章目录防火墙管理1、直接关闭防火墙2、firewalld防火墙的基本使用3、防火墙端口管理4、参考资料 CentOS7防火墙 CentOS7默认安装了firewalld防火墙 利用防火墙,我们可以允许或是限制传输的数据通过 firewall ...

    deploy_freepbx:在CentOS 7上部署Freepbx的角色

    要求该模块需要Ansible 2.2角色变量有关变量和说明,请参见默认值描述此角色的目的是将所有内容放入此处,然后将其用作角色,它基本上将采用新的CentOS 7.XX系统,并在同一台计算机上部署星号14和最新的Freepbx。...

    Linux-Setup-Scripts:我的Fedora Workstation版安装脚本

    设置基本的隐私和安全性(将umask设置为077,关闭firewalld上的开放端口,随机化mac地址,禁用ptrace,将openSnitch安装为出站防火墙,...) 设置与Timeshift兼容的BTRFS布局。 归功于 安装专有的Nvidia驱动程序...

    学习vsftpd服务的部署

    2.关闭selinux和firewalld 3.设置vsftpd状态 # systemctl start vsftpd 开启vsftpd # systemctl enable vsftpd 设置开机启动 4.测试 firefox ftp://ip lftp ip 3.vsftpd基本信息 服务名称:

Global site tag (gtag.js) - Google Analytics