最小化安装 CentOS7 后,很多端口默认是不打开的,需要通过  firewall-cmd   把这些端口打开。

检查防火墙状态

# firewall-cmd --state
running

 关闭防火墙

# systemctl stop firewalld
# firewall-cmd --state
not running

 查看开放端口列表

# firewall-cmd --list-all
public (default, active)
interfaces: docker0 enp0s3
sources:
services: dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:

暂时开放http 服务

# firewall-cmd --add-service=http

永久开放http 服务

# firewall-cmd --add-service=http --permanent

永久关闭http 服务

# firewall-cmd --remove-service=http --permanent

让设定生效

# systemctl restart firewalld

获取FirewallD 的服务名称

# firewall-cmd --get-service
amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns ftp high-availability http https imaps ipp ipp-client ipsec kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba samba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server wbem-https

查询服务的启用状态

# firewall-cmd --query-service http
yes

开放指定的端口

# firewall-cmd --add-port=/tcp
# firewall-cmd --list-all
public (default)
interfaces:
sources:
services: dhcpv6-client ftp ssh
ports: /tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:

CentOS7 防火墙 firewall-cmd的更多相关文章

  1. CentOS7防火墙firewall相关操作

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

  2. centos7防火墙--firewall

    centos7的防火墙变成firewall了 systemctl start firewalld.service#启动firewallsystemctl stop firewalld.service# ...

  3. CentOS7 防火墙Firewall常用命令

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

  4. CentOS7防火墙firewall

    一.Firewall 1. 从CentOS7开始,默认使用firewall来配置防火墙,没有安装iptables(旧版默认安装). 2. firewall的配置文件是以xml的格式,存储在 /usr/ ...

  5. CentOS7下Firewall防火墙配置用法详解

    官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...

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

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

  7. Centos7 使用firewall管理防火墙

    一.Centos7使用firewall的管理防火墙 1.firewalld基本使用 启动:systemctl start firewalld 关闭:systemctl stop firewalld 状 ...

  8. RHEL7、CentOS7防火墙管理

    经常start.stop.restart操作防火墙有两种方式: 1.service iptables stop 2./etc/init.d/iptables stop 但是经常会有这种错误,因为在RH ...

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

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

  10. CentOS7 防火墙设置

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

随机推荐

  1. android File文件的读写操作

    本程序实现两个文本框和两个按钮,其中一个文本框和一个按钮用于读取文件内容.另一个文本框和另一个按钮用于写入. java代码: package com.example.activity; import ...

  2. 类似于qq联系人的tablview能够展开和收缩

    在.h文件中定义三个数组和一个tablview UITableView *listTable;     NSMutableArray *listArray;     NSMutableArray *p ...

  3. Cocos2d-x3.0 Button

    Size widgetSize = Director::getInstance()->getWinSize(); Text* alert = Text::create("Layout& ...

  4. JAVA邮件收发实现(待)

    http://blog.csdn.net/ycg01/article/details/1394465

  5. 使用SVNkit删除版本库的文件

    源网址:http://wiki.svnkit.com/Committing_To_A_Repository Editing Operation: commiting to a repository T ...

  6. DataInputStream类readLong()引起的思考

    今天无意中看了下jdk中的DataInputStream类,然后看到readLong()方法,如下: private byte readBuffer[] = new byte[8]; public f ...

  7. docker 的安装

    官方站点上有各种环境下的 安装指南,这里主要介绍下Ubuntu和CentOS系列的安装. Ubuntu 系列安装 Docker 通过系统自带包安装 Ubuntu 14.04 版本号系统中已经自带了 D ...

  8. Java算法分析1—————寻找数组同样元素

    算法的两个评測指标:执行时间和内存消耗 要么用时间换空间,要么用空间换时间 寻找数组同样元素測试一: 0~99共100个元素各不同样,新增加一个0~99的元素不明白位置 从101个元素数组中找出与0~ ...

  9. ecshop 调用其他数据库中的商品

    ecshop中修改includes/cls_ecshop.php中第53行 function table($str) { /* if($str=='goods'){ return '`ecshop3' ...

  10. Spring jdbc 对象Mapper的简单封装

    一般查询实体的时候,都需要这么使用/**      * 根据id查询      *       * @return      */     public Emp queryEmpById(Intege ...