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

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.lryc.cn/news/2400894.html

相关文章:

  • PyTorch——搭建小实战和Sequential的使用(7)
  • 基于大模型的腔隙性脑梗塞风险预测及治疗方案研究
  • Python 开发效率秘籍:PyCharm、VS Code 与 Anaconda 配置与实战全解
  • [C]C语言日志系统宏技巧解析
  • 自动驾驶系统研发系列—激光雷达感知延迟:自动驾驶安全的隐形隐患?
  • 内网应用如何实现外网访问?无公网IP本地端口网址服务提供互联网连接
  • 大话软工笔记—组合要素1之要素
  • oracle从表B更新拼接字段到表A
  • 平台化 LIMS 系统架构 跨行业协同与资源共享的实现路径
  • RedisTemplate查询不到redis中的数据问题(序列化)
  • 如何利用乐维网管进行IP管理
  • unix/linux,sudo,其历史争议、兼容性、生态、未来展望
  • git stash命令用法
  • SkyWalking如何实现跨线程Trace传递
  • 软件工程专业的本科生应该具备哪些技能
  • 使用 Spring Boot 3.3 和 JdbcTemplate 操作 MySQL 数据库
  • CentOS 7 修改为静态 IP 地址完整指南
  • 企业级高防CDN选型指南
  • Redis-6.2.9 cluster集群部署和扩容缩容
  • Java求职者面试指南:DevOps技术栈深度解析
  • 生产环境中安装和配置 Nginx 以部署 Flask 应用的详细指南
  • Axure高保真LayUI框架 V2.6.8元件库
  • 通讯录实现(Linux+Cpp)
  • K8S主机漏洞扫描时检测到kube-服务目标SSL证书已过期漏洞的一种永久性修复方法
  • 质检 LIMS 系统数据防护指南 三级等保认证与金融级加密方案设计
  • Spring Boot 从Socket 到Netty网络编程(上):SOCKET 基本开发(BIO)与改进(NIO)
  • 79. Word Search
  • 结构性设计模式之Facade(外观)设计模式
  • ICML 2025 Spotlight | 机器人界的「Sora」!让机器人实时进行未来预测和动作执行!
  • CSP严格模式返回不存在的爬虫相关文件