新闻详情

新闻详情

首页 / 资讯中心 / 详情

Linux防火墙Centos7的常用命令

发布时间:2026/11/13 6:05:03来源:尧图网络
Linux防火墙Centos7的常用命令
文章目录一、防火墙查看状态二、防火墙启动关闭命令三、防火墙配置防火墙配置命令添加规则移除规则防火墙配置文件一、防火墙查看状态防火墙重新载入(必须重新载入后才能生效)firewall-cmd--reload防火墙查看基础状态systemctl status firewalld#查看状态查看 防火墙所有规则firewall-cmd --list-all查看rich-rules富规则)firewall-cmd --list-rich-rules查看防火墙服务规则firewall-cmd --list-services查看防火墙所有区域的配置规则firewall-cmd --list-all-zones查看默认区域firewall-cmd --get-default-zone查看网络接口使用区域firewall-cmd --get-active-zones查看默认的可用服务firewall-cmd --get-services二、防火墙启动关闭命令启动systemctl start firewalld#启动停止systemctl stop firewalld#停止重启firewall-cmd –reload#重启开机禁用systemctl disable firewalld#开机禁用开机启动systemctlenablefirewalld#开机启动三、防火墙配置防火墙配置命令添加规则在public中永久开放10022端口firewall-cmd--zonepublic --add-port10022/tcp--permanent--zone 网络区域 --permanent永久生效没有此参数重启后失效设置开放80端口开放firewall-cmd --add-servicehttp –permanent#添加一个服务permanentfirewall-cmd --add-port80/tcp –permanent# permanent上开放一个80端口允许192.168.1.10所有访问所有端口firewall-cmd--zonepublic --add-rich-rulerule familyipv4 source address192.168.1.10 accept--permanent允许192.168.2.0/24(0-255网段)所有访问所有端口firewall-cmd--zonepublic --add-rich-rulerule familyipv4 source address192.168.2.0/24 accept--permanent允许192.168.1.10所有访问TCP协议的22端口firewall-cmd--zonepublic --add-rich-rulerule familyipv4 source address192.168.1.10 port port22 protocoltcp accept--permanent移除规则移除permanent服务firewall-cmd --remove-servicehttp –permanent移除permanent服务上开放的80端口firewall-cmd --remove-port80/tcp –permanent移除192.168.1.10所有访问所有端口firewall-cmd--zonepublic --remove-rich-rulerule familyipv4 source address192.168.1.10 accept--permanent防火墙配置文件路径地址/etc/firewalld/zones/public.xml作者只用zones的空间作为举例?xml version1.0 encodingutf-8?zoneshortPublic/shortdescriptionFor use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted./descriptionservicenamessh/servicenamedhcpv6-client/servicenamecockpit/portprotocoltcpport22/rulefamilyipv4sourceaddress196.168.1.1/accept//rulerulefamilyipv4sourceaddress192.168.1.10/portport22protocoltcp/accept//rule/zone向所有ip开放端口22portprotocoltcpport10022向ip196.168.1.1开放所有端口rulefamilyipv4sourceaddress196.168.1.1/accept//rule允许ip192.168.1.10 访问 22端口rulefamilyipv4sourceaddress192.168.1.10/portport22protocoltcp/accept//rule
网站建设高端定制企业官网
RELATED

相关资讯

更多精彩内容,欢迎继续阅读

较早相关资讯

最新相关资讯

【外设】之大彩串口显示屏 2026/11/13 0:43:49

【外设】之大彩串口显示屏

大彩串口屏初步使用 1 .官网下载 STM32 屏幕 GUI 设计资料 http://www.gz-dc.com/category/typeid/4112 找到 STM32 Keil 工程,移植相关代码因项目而异进行移植,由于项目简单,本人只对用到的指令接口进行修改。 比如:注意事项&…

阅读更多 →
无法下载Windows系统iso文件 2026/11/12 23:59:09

无法下载Windows系统iso文件

当我遇到这个问题的时候,我打开了一个网站: 登录 然后我打算下载的时候: 突然那个官方的连接就可以下载了:

阅读更多 →
【清华代码熊】DeepSeek V4.1 Flash 后训练详解 2026/11/12 9:50:02

【清华代码熊】DeepSeek V4.1 Flash 后训练详解

📌 上期解析了 DeepSeek V4.1 Flash 模型架构改进,本期解析 DeepSeek V4.1 Flash 预训练/后训练技术: 🌟 预训练:45T 文本 多模态混合语料、直接训练 sparse attention(取消 DeepSeek V4 的 dense 冷启动&…

阅读更多 →
Shuffle-R1: Efficient RL framework for Multimodal Large Language Models via Data-centric Dynamic ... 2026/11/12 9:25:38

Shuffle-R1: Efficient RL framework for Multimodal Large Language Models via Data-centric Dynamic ...

文章主要内容和创新点 主要内容 本文聚焦于多模态大语言模型(MLLM)强化学习(RL)训练中的效率问题,提出了一个名为Shuffle-R1的框架。研究发现,当前RL训练存在两个关键缺陷: 优势值坍缩(Advantage Collapsing):批次中大多数优势值集中在零附近,导致有效梯度信号被淹…

阅读更多 →
PRvL: Quantifying the Capabilities and Risks of Large Language Models for PII Redaction 2026/11/12 15:57:44

PRvL: Quantifying the Capabilities and Risks of Large Language Models for PII Redaction

一、文章主要内容总结 本文聚焦于利用大型语言模型(LLMs)实现个人身份信息(PII)脱敏的研究,旨在解决传统脱敏方法(如基于规则的系统、领域特定命名实体识别(NER)模型)泛化能力差、跨格式/跨语境适应性弱的问题。 研究通过全面评估多种LLM架构(包括密集型LLM(D-LLM…

阅读更多 →
LLaVA-RE: Binary Image-Text Relevancy Evaluation with Multimodal Large Language Model 2026/11/13 0:02:27

LLaVA-RE: Binary Image-Text Relevancy Evaluation with Multimodal Large Language Model

文章主要内容和创新点 主要内容 本文聚焦于二进制图像-文本相关性评估任务(判断图像与文本“相关”或“不相关”),针对该任务中文本格式多样、相关性定义随场景变化等挑战,提出了基于多模态大语言模型(MLLM)的解决方案LLaVA-RE。 模型设计:LLaVA-RE基于LLaVA 1.5架构,…

阅读更多 →

今日资讯

本周资讯

本月资讯

看完文章仍有疑问?

联系尧图顾问,获取一对一建站咨询

立即免费咨询 📞 400-888-8888
📞 ✉