CentOS7防火墙firewall相关操作
1、firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
2、启服务停服务
systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctlstop firewalld.service
重启一个服务:systemctlrestart firewalld.service
显示一个服务的状态:systemctlstatus firewalld.service
在开机时启用一个服务:systemctlenable firewalld.service
在开机时禁用一个服务:systemctldisable firewalld.service
查看服务是否开机启动:systemctlis-enabled firewalld.service
查看已启动的服务列表:systemctllist-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
查看firewall是否运行,下面两个命令都可以
systemctl status firewalld.service
firewall-cmd --state
查看当前开了哪些端口
其实一个服务对应一个端口,每个服务对应/usr/lib/firewalld/services下面一个xml文件。
firewall-cmd --list-services
查看还有哪些服务可以打开
firewall-cmd --get-services
查看所有打开的端口:
firewall-cmd --zone=public --list-ports
更新防火墙规则:
firewall-cmd --reload
源地址:https://blog.csdn.net/u012498149/article/details/78772058
CentOS7防火墙firewall相关操作的更多相关文章
- CentOS7防火墙firewall
一.Firewall 1. 从CentOS7开始,默认使用firewall来配置防火墙,没有安装iptables(旧版默认安装). 2. firewall的配置文件是以xml的格式,存储在 /usr/ ...
- Centos7 防火墙 firewalld 实用操作
一.前言 Centos7以上的发行版都试自带了firewalld防火墙的,firewalld去带了iptables防火墙.其原因是iptables的防火墙策略是交由内核层面的netfilter网络过滤 ...
- centos7防火墙--firewall
centos7的防火墙变成firewall了 systemctl start firewalld.service#启动firewallsystemctl stop firewalld.service# ...
- CentOS7 防火墙Firewall常用命令
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disab ...
- CentOS7 防火墙firewalld详细操作
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disab ...
- centos7 防火墙一些相关设置 开机添加静态路由 特殊的方法
参考文献: https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/security_guide/s ...
- CentOS7 防火墙(firewall)的操作命令
CentOS7 防火墙(firewall)的操作命令 安装:yum install firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查 ...
- centos 7 防火墙相关操作
centos 7 防火墙相关操作 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewal ...
- CentOS7下Firewall防火墙配置用法详解
官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...
随机推荐
- bag of words
参考文献 Bag-of-words model (BoW model) 最早出现在NLP和IR领域. 该模型忽略掉文本的语法和语序, 用一组无序的单词(words)来表达一段文字或一个文档. 近年来, ...
- 2017《Java技术》预备作业02
1.学习使用Git和码云托管代码 参考资料:如何使用Git和码云 安装Git 在码云注册账号,新建项目,名称为Java-CS01(02)XXX, 一班为CS01,二班为CS02,后三位或两位为姓名缩写 ...
- Linux udhcp client (udhcpc) get IP at anytime
/*************************************************************************************** * Linux udh ...
- CF-1055E:Segments on the Line (二分&背包&DP优化)(nice problem)
You are a given a list of integers a 1 ,a 2 ,…,a n a1,a2,…,an and s s of its segments [l j ;r j ] [ ...
- 【java基础】ThreadLocal的实现原理
[一]:ThreadLocal对象的大体实现原理===>当前线程对象有一个ThreadLocal.ThreadLocalMap属性.===>声明的ThreadLocal对象最终存储在当前线 ...
- test20181025 Color
题意 分析 自己的想法 可以莫队+平衡树. 对每个颜色维护一颗平衡树,然后移动莫队端点的时候在平衡树中查询. 区间加操作容易实现. 单点修改转化为平衡树的插入删除. 感谢Z前辈的指导. 时间复杂度\( ...
- 洛谷九月月赛II
题解:模拟 一旦不匹配就要break #include<iostream> #include<cstdio> #include<cstring> #include& ...
- 在.NET中实现Actor模型的不同方式
上周,<实现领域驱动设计>(Implementing Domain-Driven Design)一书的作者Vaughn Vernon,发布了Dotsero,这是一个使用C#编写的.基于.N ...
- Android开源项目汇总
Android很多优秀的开源项目,很多UI组件以及经典的HTTP 访问开源,都能给我们带来一些自己项目的启迪或者引用. 下面简单介绍一下自己收藏的一些项目内容. 项目: Apollo音乐播放器:And ...
- HDU 2516 取石子游戏(斐波那契)
取石子游戏 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...