Centos7.5默认使用firewalld作为防火墙

1.查看firewalld服务状态 

systemctl status firewalld

2.查看firewalld的状态

firewall-cmd --state

3.开启、重启、关闭firewalld服务

# 开启
service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop

4.查看防火墙规则

firewall-cmd --list-all 

5.查询、开放、移除端口

# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp #重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload # 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;

⒍一些补充

# 关闭防火墙
systemctl stop firewalld #禁用防火墙自启
systemctl disable firewalld #安装iptables-service管理工具
yum -y install iptables-services #启动iptables
systemctl start iptables #设置为开机自启
systemctl enable iptables #清空iptables规则
iptables -F #保存到iptables默认规则
service iptables save

Centos7.5 防火墙设置的更多相关文章

  1. centos7.3 防火墙设置

    1.查看firewall服务状态 systemctl status firewalld 2.查看firewall的状态 firewall-cmd --state 3.开启.重启.关闭.firewall ...

  2. centos7.4 防火墙设置

    1.关闭默认的firewall防火墙 systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service ...

  3. Centos7关闭防火墙 设置开机启动

    [root@nmserver-7 ~]# systemctl stop firewalld.service [root@nmserver-7 ~]# systemctl status firewall ...

  4. centos7开放端口和防火墙设置

    centos7开放端口和防火墙设置. 查看防火墙状态: firewall-cmd --state 如果显示: not running 打开防火墙服务: systemctl start firewall ...

  5. CentOS7防火墙设置常用命令

    目录 开/关/重启防火墙 查看所有开启的端口号 CentOS7环境下防火墙常用命令 开/关/重启防火墙 查看防火墙状态 firewall-cmd --state 启动防火墙 systemctl sta ...

  6. centos7 tengine2.1.2 编译安装 防火墙设置

    安装 pcre 和 openssl yum -y install pcre pcre-devel yum -y install openssl openssl-devel wget http://te ...

  7. Centos7开启防火墙并且使MYSQL外网访问开放3306端口

    http://www.cnblogs.com/kreo/p/4368811.html CentOS7默认防火墙是firewalle,不是iptables #先检查是否安装了iptables servi ...

  8. Skynet服务器框架(十) CentOS 防火墙设置

    引言: 今天修改了 skynet 服务器的 IP 地址(即 config 文件中的 address 和 master 两项参数,IP 与当前及其的保持一致,端口号为 2017),然后使用一个简单的客户 ...

  9. centos7的防火墙(firewalld)

    Centos7中默认将原来的防火墙iptables升级为了firewalld,firewalld跟iptables比起来至少有两大好处: 1.firewalld可以动态修改单条规则,而不需要像ipta ...

随机推荐

  1. AGC 016 F - Games on DAG(状压dp)

    题意 给你一个有 \(n\) 个点 \(m\) 条边 DAG 图,点的标号和拓扑序一致. 现在有两个人进行博弈,有两个棋子分别在 \(1, 2\) 号点上,需要不断移动到它指向的点上. 如果当前两个点 ...

  2. 【uoj291】 ZJOI2017—树状数组

    http://uoj.ac/problem/291 (题目链接) 题意 一个写错的树状数组有多大的概率与正常树状数组得出的答案一样. Solution 可以发现这个树状数组维护的是后缀和. 所以二维线 ...

  3. 【bzoj3938】 Robot

    http://www.lydsy.com/JudgeOnline/problem.php?id=3938 (题目链接) 题意 给出数轴上$n$个点,有$m$个操作,在时间$t$让一个点以一定的速度移动 ...

  4. Dijstra算法求最短路径

    参考博客:http://blog.51cto.com/ahalei/1387799        与Floyd-Warshall算法一样这里仍然使用二维数组e来存储顶点之间边的关系,初始值如下.   ...

  5. java匹配竖线的错误警示

    String s1 = "|"; // 输出 | System.out.println(s1); String s2 = s1.replaceAll("|",& ...

  6. SqlServer存储过程详解

    SqlServer存储过程详解 1.创建存储过程的基本语法模板: if (exists (select * from sys.objects where name = 'pro_name')) dro ...

  7. A1089. Insert or Merge

    According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and gr ...

  8. Django框架之模板继承和静态文件配置

    一.模板继承 目的是:减少代码的冗余 语法: {% block classinfo %} {% endblock %} 具体步骤: 1.创建一个base.html文件,2.把要显示的页面的内容写在这里 ...

  9. 解决invalid record found in VCF4 file (at least 8 tab-delimited fields expected)问题,批量修改空格改为制表格格式

    出现这种问题说明一般存在两个问题: 第一,vcf文件不足8个分割制表符,比如像如下文件: 为了解决这个问题,说明在做snp filter时候,需要提取至少8个制表符的字符串,比如,像如下文件所示: 第 ...

  10. C#.Net 持久化对象为XML文件

    </pre><pre code_snippet_id="613717" snippet_file_name="blog_20150307_1_57950 ...