当前位置: 首页 > web >正文

CentOS7关闭防火墙、Linux开启关闭防火墙

文章目录

  • 一、firewalld开启、关闭防火墙
    • 1、查看防火墙状态

一、firewalld开启、关闭防火墙

以下命令在linux系统CentOS7中操作开启关闭防火墙

# 查询防火墙状态
systemctl status firewalld.service
# 开启防火墙
systemctl start firewalld.service
# 开机自启动防火墙
systemctl enable firewalld.service# 关闭防火墙
systemctl stop firewalld.service
# 禁止firewalld服务在系统启动时自动启动
systemctl disable firewalld.service

1、查看防火墙状态

在这里插入图片描述

  • active(running):说明防火墙打开
  • disavtive(dead):说明防火墙关闭

执行日志:

[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: active (running) since 四 2025-06-05 01:54:51 CST; 10min agoDocs: man:firewalld(1)Main PID: 3489 (firewalld)Tasks: 2CGroup: /system.slice/firewalld.service└─3489 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid6月 05 01:54:51 localhost.localdomain systemd[1]: Starting firewalld - dynamic fir....
6月 05 01:54:51 localhost.localdomain systemd[1]: Started firewalld - dynamic fire....
6月 05 01:54:52 localhost.localdomain firewalld[3489]: WARNING: AllowZoneDrifting ....
6月 05 01:54:58 localhost.localdomain firewalld[3489]: WARNING: ALREADY_ENABLED: ssh
6月 05 01:55:07 localhost.localdomain firewalld[3489]: WARNING: AllowZoneDrifting ....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)6月 05 01:54:51 localhost.localdomain systemd[1]: Starting firewalld - dynamic fir....
6月 05 01:54:51 localhost.localdomain systemd[1]: Started firewalld - dynamic fire....
6月 05 01:54:52 localhost.localdomain firewalld[3489]: WARNING: AllowZoneDrifting ....
6月 05 01:54:58 localhost.localdomain firewalld[3489]: WARNING: ALREADY_ENABLED: ssh
6月 05 01:55:07 localhost.localdomain firewalld[3489]: WARNING: AllowZoneDrifting ....
6月 05 02:05:48 localhost.localdomain systemd[1]: Stopping firewalld - dynamic fir....
6月 05 02:05:50 localhost.localdomain systemd[1]: Stopped firewalld - dynamic fire....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# 
[root@localhost ~]# ^C
[root@localhost ~]# 
http://www.xdnf.cn/news/11999.html

相关文章:

  • Linux网络协议栈:从Socket到网卡的星辰大海
  • TPU(张量处理单元)和 TVM(张量虚拟机)深度分析
  • 华为VanillaNet遇上BiFPN:YOLOv8的性能突破之旅
  • ASP.NET Core 中间件深度解析:构建灵活高效的请求处理管道
  • 隐藏层-机器学习
  • Kafka 消息队列
  • Python爬虫实战:研究Scrapy-Splash库相关技术
  • [特殊字符] FFmpeg 学习笔记
  • python做题日记(12)
  • 打卡Day44
  • Python 解释器安装全攻略(适用于 Linux / Windows / macOS)
  • 【PmHub面试篇】PmHub 整合 TransmittableThreadLocal(TTL)缓存用户数据面试专题解析
  • MySQL 5.6 Root密码修改完整流程
  • video-audio-extractor:视频转换为音频
  • Spring Boot应用开发实战
  • el-amap-bezier-curve运用及线弧度设置
  • 圣杯布局和双飞翼布局
  • Linux容器篇、第一章docker命令总结表
  • 【仿生】硬件缺失,与组装调试,皮肤问题
  • 第七十三篇 从电影院售票到停车场计数:生活场景解析Java原子类精髓
  • 如何搭建Z-Blog PHP版本:详细指南
  • pytorch 与 张量的处理
  • Neo4j 监控全解析:原理、技术、技巧与最佳实践
  • Neo4j 认证与授权:原理、技术与最佳实践深度解析
  • Elasticsearch中的语义搜索(Semantic Search)介绍
  • Axure 下拉框联动
  • Hive终极性能优化指南:从原理到实战
  • MySql安装、卸载(保姆级流程)
  • MCP客户端Client开发流程
  • python第42天打卡