CentOS7 firewalld防火墙 启动 关闭 禁用 添加删除规则等 常用命令
CentOS7 firewalld防火墙 常用命令
1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
启动一个服务: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
2.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
端口的增、删、查(以80端口为例)
添加
firewall-cmd –zone=public –add-port=80/tcp –permanent (–permanent永久生效,没有此参数重启后失效)
删除
firewall-cmd –zone= public –remove-port=80/tcp –permanent
重新载入
firewall-cmd –reload
查看
firewall-cmd –zone= public –query-port=80/tcp
CentOS7 firewalld防火墙 启动 关闭 禁用 添加删除规则等 常用命令的更多相关文章
- CentOS7,Firewalld防火墙使用方法
查看防火墙状态 systemctl status firewalld.service 启动firewall systemctl stop firewalld.service 停止firewall sy ...
- CentOS7 firewalld防火墙规则
在CentOS7里有几种防火墙共存:firewalld.iptables.ebtables,默认是使用firewalld来管理netfilter子系统,不过底层调用的命令仍然是iptables等. f ...
- 添加/删除-HTML DOM 常用对象 -BOM-打开和关闭窗口- history-location
1. 添加/删除 3步: 1. 添加一个空元素 var a=document.createElement("a"); <a></a> 2. 定义元素的关键属 ...
- tar命令,重定向,正则表达式,添加删除用户,tr命令,sort排序
rpm包仅用于 redhat suse redflag 若是源代码包的话,那就都适用linux下面的备份,差不多就是用tar打包 tar命令用途:制作归档文件,释放归档文件格式:tar [选项]... ...
- 关于Centos7 firewalld防火墙开放端口后仍不能访问ftp和nginx的问题解决
我在阿里轻量应用服务器搭建ftp服务器这篇博客中把防火墙换为iptables,因为当时无论我怎么设置firewalld,就是无法访问ftp服务器,今天在翻看其他博客的时候,突然发现firewalld有 ...
- Centos7.2正常启动关闭CDH5.16.1
1.正常的启动.关闭流程 关闭流程 cluster1 stop Cloudera Management Service stop 4台agent:systemctl stop cloudera ...
- centos7 选定默认启动内核,及删除无用内核
#使用cat /boot/grub2/grub.cfg |grep menuentry 查看系统可用内核 [root@bigapp-slave27 ~]# cat /boot/grub2/grub.c ...
- CentOS7 firewalld防火墙配置
[root@ecs ~]# firewall-cmd --version //查看版本0.3.9 [root@ecs ~]# firewall-cmd --state //查 ...
- Linux防火墙:iptables禁IP与解封IP常用命令
在Linux服务器被攻击的时候,有的时候会有几个主力IP.如果能拒绝掉这几个IP的攻击的话,会大大减轻服务器的压力,说不定服务器就能恢复正常了. 在Linux下封停IP,有封杀网段和封杀单个IP两种形 ...
随机推荐
- centos7安装mysql注意点
yum安装yum -y install mariadb-server 启动服务systemctl start mariadb.service 开机自动启动systemctl enable mariad ...
- 【Java_基础】HashMap的工作原理
转载至博客:HashMap的工作原理
- Shell 编程 until语句
本篇主要写一些shell脚本until语句的使用. 计算1-50的和 #!/bin/bash i=0 s=0 until [ $i -eq 51 ];do let s+=i;let i++ done ...
- Python基础(二)--基本数据类型、格式化输出、基本运算符
一.基本数据类型 1.数字类型 #int整型 定义:age=10 #age=int(10) 用于标识:年龄,等级,身份证号,qq号,个数 #float浮点型 定义:salary=3.1 #salary ...
- CAS 集群部署
业务场景 单点登录服务器如果压力过大的情况,那么可以使用集群分担压力,但是cas 默认不支持session同步. 所以可以需要做session同步,可以使用j2cache 实现session同步.另外 ...
- Linux用户权限管理
Linux操作系统: 多用户多任务的操作系统 用户类型分为: 管理员用户 : root 普通用户分为:系统用户/程序用户 用户相关的文件: /etc/passwd 用 ...
- Lua语法要点2
[Lua语法要点2] 1.Lua函数 function 可以添加 local 关键字.添加后为局部函数,不添加(默认)为全局函数.return 可以返回多个返回值,以, 分隔. 使用 ... 来表示变 ...
- soeasy的键盘鼠标事件
在web自动化中,我们可能会遇到需要通过键盘或者鼠标去操作某些元素,那么我们就需要用到键盘事件和鼠标事件了,今天对键盘和鼠标操作进行一个总结 鼠标事件 鼠标事件需要引入ActionChains类,查看 ...
- 腾讯面试Android高级岗,居然被一个多线程基础面倒了?
前言 一个在深圳从事开发五年的老友一个月前从原公司辞职后,昨天去腾讯总部面试Android高级岗,一面的时候,自我介绍后,陆陆续续问了很多问题,有着五年的从业经验很多项目开发的技术问题都回答的很通顺, ...
- nginx在linux下安装(源码编译)
下载 http://nginx.org/en/download.html 安装 安装依赖 yum -y install gcc gcc-c++ zlib zlib-devel pcre-devel o ...