centos7 防火墙简单使用firewall

Posted zhangyy3

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 防火墙简单使用firewall相关的知识,希望对你有一定的参考价值。


firewall-cmd --stat

firewall-cmd --reload

增加规则

firewall-cmd --zone=public --add-port=3306/tcp --permanent
#centos7启动防火墙
systemctl start firewalld.service
#centos7停止防火墙/关闭防火墙
systemctl stop firewalld.service
#centos7重启防火墙
systemctl restart firewalld.service


#设置开机启用防火墙
systemctl enable firewalld.service
#设置开机不启动防火墙
systemctl disable firewalld.service

#centos7查看防火墙所有信息
firewall-cmd --list-all
#centos7查看防火墙开放的端口信息
firewall-cmd --list-ports

增加规则
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=8090/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports

以上是关于centos7 防火墙简单使用firewall的主要内容,如果未能解决你的问题,请参考以下文章

RHEL7 CentOS7 的 firewall命令简单介绍

RHEL7 CentOS7 的 firewall命令简单介绍

CentOS7 - Firewalld 简单上手

CentOS7 防火墙的简单使用

Centos7 Firewall 防火墙配置应用实例参考(转)

Centos7 Firewalld使用