centos firewalld 基本操作【转】
1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl 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
转自 https://www.cnblogs.com/moxiaoan/p/5683743.html
centos firewalld 基本操作【转】的更多相关文章
- NO.4day LINUX centos 文件基本操作
LINUX centos 文件基本操作 1 LINUX简介 Linux的定义:Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户.多任务.支持多线程和多CP ...
- CentOS firewalld 防火墙操作
Centos 7 开启端口CentOS 7 默认没有使用iptables,所以通过编辑iptables的配置文件来开启80端口是不可以的 CentOS 7 采用了 firewalld 防火墙 如要查询 ...
- centos文件基本操作
centos彻底删除文件夹.文件命令(centos 新建.删除.移动.复制等命令: 1.新建文件夹 mkdir 文件名 新建一个名为test的文件夹在home下 view source1 mkdir ...
- centos的基本操作
1.ssh连接阿里云一段时间不操作自动断开打开/etc/ssh/sshd_config添加或修改: ClientAliveInterval 120ClientAliveCountMax 0 2.挂载数 ...
- centos防火墙操作
centos防火墙基本操作 #/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT#/sbin/iptables -I INPUT -p tcp -- ...
- Linux CentOS 知识和常用命令
1.常用热键 [Tab]它具有“命令补全”与“文件补全”的功能[Ctrl+C]中断执行中的程序组合键[Ctrl+d]键盘输入结束.也可以用来替代 exit 2.Linux 常用编辑器 vi 和 vim ...
- 2、linux防火墙的使用(firewalld)
2.1.说明: 1.在 RHEL7 里有几种防火墙共存,firewalld.iptables,默认是使用 firewalld 来管理 netfilter 子系统,不过底层调用的命令仍然是 iptabl ...
- CentOS7防火墙firewalld的配置
开机启动的开启与禁止 # 开机启动 systemctl enable firewalld # 禁止开机启动 systemctl disable firewalld 基本操作 # 查看状态 system ...
- Linux--02软件安装、防火墙设置
防火墙设置: With RHEL / CentOS , firewalld was introduced to manage iptables. IMHO, firewalld is more sui ...
随机推荐
- RxJS之组合操作符 ( Angular环境 )
一 merge操作符 把多个 Observables 的值混合到一个 Observable 中 import { Component, OnInit } from '@angular/core'; i ...
- jquery--blur()事件,在页面加载时自动获取焦点
jquery--blur()事件会在页面加载时自动获取焦点,应将onblur写到html标签中 <div class="inputbox"> <input typ ...
- [LeetCode_105]Construct Binary Tree from Preorder and Inorder Traversal
题目链接 https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 题意 由二叉 ...
- JDBC、ODBC、OLE DB、ADO、ADOMD区别与联系
ODBC: (Open Database Connectivity,开放数据库互连),它建立了一组规范,并提供了一组对数据库访问的标准API(应用程序编程接口).这些API利用SQL来完成其大部分任务 ...
- sqlite 数据库错误 The database disk image is malformed database disk image
收银机上的sqlite数据库经常出现这种错误,错误的原因有可能是突然断电或是一些不规范操作导致的. 网上一般的做法有两种: 方法一: 1.在https://www.sqlite.org/downloa ...
- php新增的一些特性
php新增的特性,只是略微整理,并不完全. 一.php5.3添加的新特性 1.?:简化的三元运算符 <?php $cur = $cur ? $cur : 1; $cur = $cur ?: 1; ...
- Centos7上安装docker及使用scrapy-splash
下载docker https://www.cnblogs.com/yufeng218/p/8370670.html 安装scrapy-splash https://www.cnblogs.com/ ...
- DevExpress中RibbonControl的简单应用
现在介绍一下DevExpress中的RibbonControl的简单应用,搭建一个拥有Office2010风格的窗体程序. 第一步:打开VS2015,新建一个windows窗体应用程序: 第二步:把需 ...
- 引用类型中的push()、pop()、shift()方法
/** * write by waitingbar1014 * time 2013.10.18 * 用途:常用于如一堆游戏激活码中获得抽取的值 * **/ //有以下一个数组: var arrayli ...
- Centos安装配置Postfix邮件服务器--网址
http://www.haiyun.me/archives/centos-install-postfix.html http://blog.csdn.net/liuyunfengheda/articl ...