服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - 服务器知识 - 银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

2023-10-06 14:38费尔柳成危 服务器知识

本文主要为大家介绍下银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)常用指令,有需要的朋友可以参考下

一、Kylin系统查看firewalld状态

systemctl status firewalld (或者:systemctl status firewalld.service,或者:systemctl is-active firewalld)active(running):表示防火墙已经开启。

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

二、开启、重启、关闭firewalld服务

1、开启:systemctl start firewalld 查看状态: systemctl status firewalld

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

2、关闭:systemctl stop firewalld 查看状态:systemctl status firewalld

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

3、重启:systemctl restart firewalld 查看状态:systemctl status firewalld

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

三、设置、取消开机启动(firewalld)

1、设置开机启动firewalld:systemctl enable firewalld

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

2、开机关闭防火墙firewalld:systemctl disable firewalld

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

3、查询是否开机启动firewalld:systemctl is-enabled firewalld(enabled表示开机启动防火墙,disabled表示开机关闭防火墙)

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

四、查询、开放、关闭firewalld端口

1、查询全部已开放的端口:firewall-cmd --list-all

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

2、查询某个端口是否开放:firewall-cmd --query-port=[端口]/tcp,yes表示已经开放,no表示没有开放。

[root@localhost /]# firewall-cmd --query-port=3306/tcp

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

3、开放端口:firewall-cmd --permanent --add-port=[端口]/tcp,succes表示开方端口成功,如果开放已经开放的端口会报错如下图:

[root@localhost /]# firewall-cmd --permanent --add-port=3303/tcp

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

4、关闭端口:firewall-cmd --permanent --remove-port=[端口]/tcp,success表示关闭成功。

[root@localhost /]# firewall-cmd --permanent --remove-port=3303/tcp

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

5、刷新服务(开放、关闭端口操作后需要刷新才能生效):firewall-cmd --reload,success表示刷新成功。

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

到此这篇关于银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令的文章就介绍到这了,更多相关内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文地址:https://blog.csdn.net/weixin_43741718/article/details/131660085

延伸 · 阅读

精彩推荐