开机启动的开启与禁止

# 开机启动
systemctl enable firewalld # 禁止开机启动
systemctl disable firewalld

基本操作

# 查看状态
systemctl status firewalld # 启动/停止/重启firewalld
systemctl start firewalld
systemctl stop firewalld
systemctl restart firewalld

服务、端口的添加与删除

# 添加服务,其实就是开启22端口
firewall-cmd --permanent --add-service=ssh # 添加端口
firewalld-cm --permanent --add-port=1234/tcp # 删除服务
firewalld-cm --permanent --remove-service=ssh # 删除端口
firewalld-cm --permanent --remove-port=1234/tcp

使操作生效

firewall-cmd --reload

查看被firewalld允许的服务

firewall-cmd --permanent --list-all

端口转发

# 将80端口转发至8080
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080 # 将80端口转发至192.168.0.1
firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1 # 将80端口的流量转发至192.168.0.1的8080端口
firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1:toport=8080 # 删除端口转发
firewall-cmd --remove-forward-port=port=80:proto=tcp:toaddr=192.168.0.1

CentOS7防火墙firewalld的配置的更多相关文章

  1. CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令

    CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...

  2. 5分钟理解Centos7防火墙firewalld

    版权声明:本内容为原创内容,转载请声明出处. 原文地址:http://www.excelib.com/article/287/show firewalld简介 Centos7中默认将原来的防火墙ipt ...

  3. fedora/centos7防火墙FirewallD详解

    1 使用 FirewallD 构建动态防火墙 1.1 “守护进程” 1.2 静态防火墙(system-config-firewall/lokkit) 1.3 使用 iptables 和 ip6tabl ...

  4. CentOS7.3防火墙firewalld简单配置

    今天安装了centos7.3, 想用iptables的save功能保存规则的时候发现跟rhel不一样了,  后来度娘说centos用的是firewalld而不是iptables了, 平时工作都是用re ...

  5. Centos7 防火墙firewalld配置

    开启80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent  出现success表明添加成功 移除某个端口 firewall-cmd ...

  6. CentOS7 防火墙firewalld详细操作

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

  7. Centos7 防火墙 firewalld 实用操作

    一.前言 Centos7以上的发行版都试自带了firewalld防火墙的,firewalld去带了iptables防火墙.其原因是iptables的防火墙策略是交由内核层面的netfilter网络过滤 ...

  8. CentOS7防火墙firewalld使用

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  9. CentOS7防火墙firewalld

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

随机推荐

  1. Matlab解析LQR与MPC的关系

    mathworks社区中的这个资料还是值得一说的. 1 openExample('mpc/mpccustomqp') 我们从几个角度来解析两者关系,简单的说就是MPC是带了约束的LQR. 在陈虹模型预 ...

  2. 理解feof与EOF

    feof(feof msdn) feof用于判断文件结尾.头文件<cstdio>.使用方法是feof(fp),fp为指向需要判断的文件的指针.如果不到文件结尾,返回0值:如果是文件结尾,返 ...

  3. H5扇形

    使用H5 canvas绘制的可交互扇形 requestAnimationFrame() 现有动画实现方式的不足 setTimeout和setInterval都不十分精确.为它们传入的第二个参数,实际上 ...

  4. 设计模式之:抽象工厂模式AbstractFactoryPattern的实现

    相比于工厂模式,抽象工厂模式的每个工厂可以创建产品系列,而不是一个产品: 抽象工厂用到的技术:接口.多态.配置文件.反射: 抽象工厂模式的设计原则: 实现客户端创建产品和使用产品的分离,客户端无须了解 ...

  5. SpringBoot快速入门(解析+入门案例源码实现)

    这里写目录标题 SpringBoot入门 一.SpringBoot 概念 二.JavaConfig 入门 1. JavaConfig 概念 2. 项目准备 三.常用注解 四.SpringBoot 入门 ...

  6. Eclipse的视窗和视图概述、Eclipse工作空间的基本配置

    Eclipse的视窗和视图概述视窗  每一个基本的窗体被称为视窗 * PackageExplorer  显示项目结构,包,类,及资源 * Outline   显示类的结构,方便查找,识别,修改 * C ...

  7. css3种不知道宽高的情况下水平垂直居中的方法

    第一种:display:table-cell 组合使用display:table-cell和vertical-align.text-align,使父元素内的所有行内元素水平垂直居中(内部div设置di ...

  8. 输入n,然后输入n个数,使它升序输出

    #include<iostream> using namespace std; int main() { int n,i,j,m,k; cin>>n; int a[n];  f ...

  9. Mybatis模糊查询结果为空的解决方案

    写在前面 Mybatis使用模糊查询,查询结果为空的解决方案,我的代码是 select * from sp_user where 1=1 <if test="username!=nul ...

  10. redis的基础命令操作

    文章目录 前言 一.字符串类型 二.哈希类型 三.列表类型 四.集合类型 五.有序集合类型 六.通过命令 前言 redis的数据结构 redis存储的是key,value格式的数据,其中的key是字符 ...