Centos7:
查看防火墙状态:
firewall-cmd --state
开启防火墙:
systemctl start firewalld.service
关闭防火墙(重启失效):
systemctl stop firewalld.service
开机不启动防火墙:
systemctl disable firewalld.service
开机启动防火墙:
systemctl enable firewalld.service
重启防火墙:
firewall-cmd --reload
查看已开放端口:
firewall-cmd --list-ports
查看指定端口状态(以1521端口为例):
firewall-cmd --zone=public --query-port=1521/tcp
开放指定端口:
firewall-cmd --zone=public --add-port=1521/tcp --permanent
关闭指定端口:
firewall-cmd --zone=public --remove-port=1521/tcp --permanent
开放、关闭端口注意:
重启防火墙才生效
--permanent:永久生效,否则重启失效
Centos6:
查看防火墙状态:
service iptables status
开启防火墙:
service iptables start
关闭防火墙(重启失效):
service iptables stop
开机不启动防火墙:
chkconfig iptables off
开机启动防火墙:
chkconfig iptables on
查看端口状态:
/etc/init.d/iptables status
重启防火墙
service iptables restart
开放指定端口:
修改 /etc/sysconfig/iptables 文件:
添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
保存重启防火墙

Centos6、Centos7防火墙基本操作整理的更多相关文章

  1. centos6|centos7防火墙区别 | 网络配置区别

    CentOS 6 Linux防火墙 service iptables status (功能描述:查看防火墙状态) chkconfig iptables –list (功能描述:查看防火墙开机启动状态) ...

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

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

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

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

  4. CentOS7防火墙问题

    CentOS6关闭防火墙使用以下命令, //临时关闭service iptables stop//禁止开机启动chkconfig iptables off CentOS7中若使用同样的命令会报错, s ...

  5. Centos7防火墙快速开放端口配置方法

    ▲这篇文章主要为大家详细介绍了Centos7防火墙开放端口的快速方法,感兴趣的小伙伴们可以参考一下! Firewalld服务是红帽RHEL7系统中默认的防火墙管理工具,特点是拥有运行时配置与永久配置选 ...

  6. #openstack centos6 centos7 kvm镜像制作

    #openstack centos6 centos7 kvm 镜像制作 openstack windows 2008镜像 制作 http://www.cnblogs.com/elvi/p/800129 ...

  7. CentOS7 防火墙(firewall)的操作命令

    CentOS7 防火墙(firewall)的操作命令 安装:yum install firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查 ...

  8. (转)搭建企业内部yum仓库(centos6+centos7+epel源)

    搭建企业内部yum仓库(centos6+centos7+epel源) 原文:https://www.cnblogs.com/nulige/p/6081192.html https://www.linu ...

  9. [转帖]Centos7防火墙配置rich-rule实现IP端口限制访问

    Centos7防火墙配置rich-rule实现IP端口限制访问 2019-02-18 18:05:35 sunny05296 阅读数 2143  收藏 更多 分类专栏: Linux   版权声明:本文 ...

随机推荐

  1. asp.net core 从 3.0 到 3.1

    asp.net core 从 3.0 到 3.1 Intro 今天 .net core 3.1 正式发布了,.net core 3.1 正式版已发布,3.1 主要是对 3.0 的 bug 修复,以及一 ...

  2. Java8 日期时间API

    一.转换 1.与字符串 //LocalDateTime 转 字符串 String str = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss ...

  3. linux免密登录和设置别名

    一.免密登录 (1) 配置公钥   ssh-keygen (2)让远程服务器记住公钥   ssh-copy-id   用户名@ip地址或域名 二.设置别名 (3)在~/.ssh目录下创建并编辑conf ...

  4. ThreadLocal 源码解读

    一.引入 public class Thread implements Runnable { /* 前面略 */ /* ThreadLocal values pertaining to this th ...

  5. mq解决分布式事物问题【代码】

    上节课简单说了一下mq是怎么保证数据一致性的.下面直接上代码了. 所需环境:1.zookeepor注册中心   2.kafka的服务端和工具客户端(工具客户端也可以不要只是为了更方便的查看消息而已)  ...

  6. 自然语言处理(NLP) - 数学基础(1) - 总述

    正如我在<2019年总结>里说提到的, 我将开始一系列自然语言处理(NLP)的笔记. 很多人都说, AI并不难啊, 调现有库和云的API就可以啦. 然而实际上并不是这样的. 首先, AI这 ...

  7. sticker-footer布局

    目录 1.嵌套层级不深,可直接继承自 body width:100%: height:100%; 2.嵌套层级很深,无法直接从上级继承 百分比高度的 第一种方法:给需要的 sticker-footer ...

  8. 大数据之Linux进阶指令

    1.文件内容操作相关命令 cut 根据条件 从命令结果中 提取 对应内容 -c  按字符选取内容 例子:head -2 1.txt | cut -c 5 截取前两行的第五个字符 -d  '分隔符'  ...

  9. [TimLinux] Python 再谈元类 metaclass

    本博文通过对以下链接进行理解后,编写. https://stackoverflow.com/questions/100003/what-are-metaclasses-in-python 1. 类 类 ...

  10. 2017 CCPC秦皇岛 L题 One Dimensions Dave

    BaoBao is trapped in a one-dimensional maze consisting of  grids arranged in a row! The grids are nu ...