开机启动的开启与禁止

# 开机启动
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. BMZCTF SDNISC2020_过去和现在

    SDNISC2020_过去和现在 打开附件就一张图片 根据题意感觉是图片中隐藏了什么信息 使用binwalk -e分离这里foremost不行 三个文件查看在第一个中发现flag

  2. IdentityServer4系列 | 混合模式

    一.前言 在上一篇关于授权码模式中, 已经介绍了关于授权码的基本内容,认识到这是一个拥有更为安全的机制,但这个仍然存在局限,虽然在文中我们说到通过后端的方式去获取token,这种由web服务器和授权服 ...

  3. 接口combine

    需求描述 进行复杂项目开发时,服务端(数据接口实现端)会把接口拆分的比较细粒度,以方便在更多地方复用.而拆分后的接口在前端进行组合请求时,通常会出现一个区块要请求5.6个接口甚至更多接口请求才能拿到想 ...

  4. 【Android开发】Coding + git命令行基本使用

    上传代码 进入本地仓库的目录. cd ... 查看仓库链接 : git remote -v 如果没有,则添加url链接 : git remote add testName https://git.co ...

  5. java中设置准确的时间日期类的用法

    5.日期Date相关类: 题目1: 设置准确的时间(jdk1.1以后Date的setHours不被推荐了,所以要用Calendar设置时间) import java.util.*;public cla ...

  6. mysql-加密函数

    1.PASSWORD(str)一般对用户的密码加密 不可逆 2.MD5(str) 普通加密 不可逆 3.ENCODE(str,pswd_str) 加密函数,结果是一个二进制数,必须使用 BLOB 类型 ...

  7. 解决一次calico异常情况,pod之间访问pod ip不通

    k8s 集群采用二进制安装,cni网络插件用calico通讯问题描述:发现有些pod不是很正常例如: ht13.node正常系统采样 [root@ht6 ~]# cat /etc/redhat-rel ...

  8. flink调优之RocksDB设置

    一.开启监控 RocksDB是基于LSM Tree实现的,写数据都是先缓存到内存中,所以RocksDB的写请求效率比较高.RocksDB使用内存结合磁盘的方式来存储数据,每次获取数据时,先从内存中bl ...

  9. Java学习day9

    抽象类的关键字:abstract 类中有抽象方法时,需要在类名前也加上abstract关键字,即 public abstract class 类名{ } 同时,抽象类不能直接实例化,需要通过子类继承, ...

  10. go源码阅读 - container/ring

    相比于List,环的结构有些特殊,环的头部就是尾部,所以每个元素可以代表自身这个环.环其实是一个双向回环链表.type Ring struct { next, prev *Ring Value int ...