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

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.lqws.cn/news/126667.html

相关文章:

  • Linux 的 find 命令使用指南
  • 构建 MCP 服务器:第一部分 — 资源入门
  • django ssh登录 并执行命令
  • Linux 特殊权限位详解:SetUID, SetGID, Sticky Bit
  • 网络可靠性的定义与核心要素
  • Redis初识
  • Git-git跟踪大文件
  • 01串(二进制串)与集合之间存在天然的对应关系 ← bitset
  • 第三篇:MCP协议深度实践——从理论到生产级AI智能体系统
  • 如何设计订单号生成策略?
  • Java基础原理与面试高频考点
  • Python网页数据抓取常用的库及方法介绍
  • 稻米分类和病害检测数据集(猫脸码客第237期)
  • 第八部分:阶段项目 6:构建 React 前端应用
  • LeetCode[513]找树左下角的值
  • postman自动化测试
  • JVMTI 在安卓逆向工程中的应用
  • 国际数字影像产业园智慧办公赋能文创企业加速成长​
  • PyTest框架学习
  • SARIMA时间序列分析:三大模型对比
  • Efficient RAW Image Deblurring with Adaptive Frequency Modulation
  • 代码训练LeetCode(21)跳跃游戏2
  • 数据分析之OLTP vs OLAP
  • [C++入门]简化的艺术---对模版的初步探索
  • powershell 安装 .netframework3.5
  • Linux基本指令(三)
  • 程一笑的AI梦何时醒?
  • Kafka深度技术解析:架构、原理与最佳实践
  • Spring Boot 从Socket 到Netty网络编程(上):SOCKET 基本开发(BIO)与改进(NIO)
  • 【dynamic-datasource】动态数据源切换失效的深度解析与解决方案