当前位置: 首页 > 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 ~]# 

相关文章:

  • WebFuture:Ubuntu 系统上在线安装.NET Core 8 的步骤
  • OpenCV 键盘响应来切换图像
  • 实现C语言中srand()和rand()函数
  • .NET Core接口IServiceProvider
  • iptables实战案例
  • 【.net core】【watercloud】树形组件combotree导入及调用
  • Asp.net Core 通过依赖注入的方式获取用户
  • itop-3568开发板机器视觉opencv开发手册-图像绘制-画线
  • 【p2p、分布式,区块链笔记 MESH】 论文阅读 Thread/OpenThread Low-Power Wireless Multihop Net
  • Mac/iOS 如何解压 RAR 格式压缩包:常用工具与详细操作步骤
  • 【vue3学习】vue3入门
  • Flink进阶之路:解锁大数据处理新境界
  • iOS上传应用包错误问题 “Invalid bundle. The “UIInterfaceOrientationPortrait”“
  • ios版本的Tiktok二次安装不上,提示:Unable to Install “TikTok”
  • 使用 Amazon Q Developer CLI 快速搭建各种场景的 Flink 数据同步管道
  • Monorepo架构: 项目管理模式对比与考量
  • UE 材质基础第三天
  • 第12节 Node.js 函数
  • UniApp 全生命周期钩子详解
  • docker镜像下载到本地,并导入服务器
  • 六安网站怎么做seo/免费下载百度app最新版本
  • 云服务器的特点/seo外链建设方法
  • 做网站点击软件/百度推广官网首页
  • 做网站推广选哪家/百度官方版
  • 郑州便宜网站建设/网站推广公司电话
  • 宠物网站建设的目的/博客网站登录