CentOS7环境下防火墙常用命令

开/关/重启防火墙

  1. 查看防火墙状态

    firewall-cmd --state
  2. 启动防火墙

    systemctl start firewalld.service
  3. 设置开机自启

    systemctl enable firewalld.service
  4. 查看防火墙设置开机自启是否成功

    systemctl is-enabled firewalld.service;echo $?
  5. 重启防火墙

    systemctl restart firewalld.service
  6. 关闭防火墙

    systemctl stop firewalld.service

开启端口号

#命令
firewall-cmd --zone=public --add-port=80/tcp --permanent
#重启防火墙
systemctl restart firewalld.service # --permanent 永久生效,否则重启后失效
# --zone 作用域
# --add-port=80/tcp 端口/通讯协议

查看所有开启的端口号

firewall-cmd --list-ports

CentOS7防火墙设置常用命令的更多相关文章

  1. CentOS7 防火墙Firewall常用命令

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

  2. linux防火墙设置常用命令

    1.永久性生效,重启后不会复原 开启: chkconfig iptables on 关闭: chkconfig iptables off 2.即时生效,重启后复原 开启: service iptabl ...

  3. 【RHEL7/CentOS7防火墙之firewall-cmd命令详解】

    目录 Firewalld zone firewall-cmd 开始配置防火墙策略 总结 Redhat Enterprise Linux7已默认使用firewalld防火墙,其管理工具是firewall ...

  4. CentOS7 防火墙设置

    CentOS7 防火墙命令 最近在公司服务器上安装了oracle12c数据库,在用数据库客户端连接的时候,连接不了.最后查找资料的原因是因为oracle的服务端口未开放. 首先还是还是输入以往的开启某 ...

  5. centos7防火墙设置

    前言 CentOS7 与之前版本在防火墙配置上不同,防火墙从iptables变成了firewalld Centos7默认安装了firewalld,如果没有安装的话,可以使用yum命令进行安装 yum ...

  6. Centos6与Centos7防火墙设置与端口开放的方法

    Centos升级到7之后,内置的防火墙已经从iptables变成了firewalld.所以,端口的开启还是要从两种情况来说明的,即iptables和firewalld.更多关于CentOs防火墙的最新 ...

  7. Centos6,Centos7防火墙设置与端口开放的方法

    Centos升级到7之后,内置的防火墙已经从iptables变成了firewalld.端口的开启还是要从两种情况来说明的,即iptables和firewalld. 一.iptables 1.打开/关闭 ...

  8. Linux 防火墙设置常用指令

    查看防火墙状态命令: service firewalld status systemctl status firewalld 结果: 其中:   enabled:开机启动(开机不启动是disabled ...

  9. CentOS7下Firewall常用命令

    安装它,只需 yum install firewalld 如果需要图形界面的话,则再安装 yum install firewall-config 一.介绍 防火墙守护 firewalld 服务引入了一 ...

随机推荐

  1. js笔记(5)--location的用法

    !DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"&g ...

  2. 视觉slam十四讲课后习题ch3--5题

    题目回顾: 假设有一个大的Eigen矩阵,我想把它的左上角3x3块提取出来,然后赋值为I3x3.编程实现.解:提取大矩阵左上角3x3矩阵,有两种方式: 1.直接从0-2循环遍历大矩阵的前三行和三列 2 ...

  3. Java1变量数据类型和运算符

    day02_变量数据类型和运算符   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public class jh_01_数据类型说明 {     public  ...

  4. LeetCode 23 Hard,K个链表归并

    本文始发于个人公众号:TechFlow,原创不易,求个关注 链接 Merge k Sorted Lists 难度 Hard 描述 Merge k sorted linked lists and ret ...

  5. 大话IDL之(基本操作流程)

    这里将对ENVI-IDL二次开发程序的一个通用流程做一个总结. 1.首先是文件打开和数据读取: 文件打开work_dir = dialog_pickfile(title='选择路径',/directo ...

  6. ubuntu 配置网卡,DNS, iptables

    # 配置静态ip地址 root@simon:~# vim /etc/network/interfaces auto enp4s0 iface enp4s0 inet static address 19 ...

  7. HDP之HBase性能调优

    (官方文档翻译及整理) 一.系统级调优 1.保证充足的RAM 2.64位的操作系统 3.Linux的swappiness设置为0 : sysctl vm.swappiness=10 vim /etc/ ...

  8. Vue子组件和根组件的关系

    代码: <script type="text/javascript"> const Foo = Vue.extend({ template: `<div id=& ...

  9. A——大整数加法(HDU1002)

    题目: I have a very simple problem for you. Given two integers A and B, your job is to calculate the S ...

  10. 【转】Redis内部数据结构详解 -- skiplist

    本文是<Redis内部数据结构详解>系列的第六篇.在本文中,我们围绕一个Redis的内部数据结构--skiplist展开讨论. Redis里面使用skiplist是为了实现sorted s ...