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

windows 查看防火墙设置命令使用方法

点击键盘上windows键,输入cmd,选择以管理员身份运行

 输入下面命令查看使用说明

netsh advfirewall firewall add rule ?

发现显示不全,不方便看

可以输入下面命令,生成文件,方便查看

netsh advfirewall firewall add rule ? >d:\1.log

不会再终端窗体上显示了

会在d盘根目录下生成1.log这个文件

双击打开查看

发现显示全了,内容如下


用法: add rule name=<string>dir=in|outaction=allow|block|bypass[program=<program path>][service=<service short name>|any][description=<string>][enable=yes|no (default=yes)][profile=public|private|domain|any[,...]][localip=any|<IPv4 address>|<IPv6 address>|<subnet>|<range>|<list>][remoteip=any|localsubnet|dns|dhcp|wins|defaultgateway|<IPv4 address>|<IPv6 address>|<subnet>|<range>|<list>][localport=0-65535|<port range>[,...]|RPC|RPC-EPMap|IPHTTPS|any (default=any)][remoteport=0-65535|<port range>[,...]|any (default=any)][protocol=0-255|icmpv4|icmpv6|icmpv4:type,code|icmpv6:type,code|tcp|udp|any (default=any)][interfacetype=wireless|lan|ras|any][rmtcomputergrp=<SDDL string>][rmtusrgrp=<SDDL string>][edge=yes|deferapp|deferuser|no (default=no)][security=authenticate|authenc|authdynenc|authnoencap|notrequired(default=notrequired)]备注:- 将新的入站或出站规则添加到防火墙策略。- 规则名称应该是唯一的,且不能为 "all"。- 如果已指定远程计算机或用户组,则 security 必须为authenticate、authenc、authdynenc 或 authnoencap。- 为 authdynenc 设置安全性可允许系统动态协商为匹配给定 Windows Defender 防火墙规则的通信使用加密。根据现有连接安全规则属性协商加密。选择此选项后,只要入站 IPsec 连接已设置安全保护,但未使用 IPsec 进行加密,计算机就能够接收该入站连接的第一个 TCP 或UDP 包。一旦处理了第一个数据包,服务器将重新协商连接并对其进行升级,以便所有后续通信都完全加密。- 如果 action=bypass,则 dir=in 时必须指定远程计算机组。- 如果 service=any,则规则仅应用到服务。- ICMP 类型或代码可以为 "any"。- Edge 只能为入站规则指定。- AuthEnc 和 authnoencap 不能同时使用。- Authdynenc 仅当 dir=in 时有效。- 设置 authnoencap 后,security=authenticate 选项就变成可选参数。示例:为不具有封装的 messenger.exe 添加入站规则:netsh advfirewall firewall add rule name="allow messenger"dir=in program="c:\programfiles\messenger\msmsgs.exe"security=authnoencap action=allow为端口 80 添加出站规则:netsh advfirewall firewall add rule name="allow80"protocol=TCP dir=out localport=80 action=block为 TCP 端口 80 通信添加需要安全和加密的入站规则:netsh advfirewall firewall add rulename="Require Encryption for Inbound TCP/80"protocol=TCP dir=in localport=80 security=authdynencaction=allow为 messenger.exe 添加需要安全的入站规则:netsh advfirewall firewall add rule name="allow messenger"dir=in program="c:\program files\messenger\msmsgs.exe"security=authenticate action=allow为 SDDL 字符串标识的组 acmedomain\scanners 添加经过身份验证的防火墙跳过规则:netsh advfirewall firewall add rule name="allow scanners"dir=in rmtcomputergrp=<SDDL string> action=bypasssecurity=authenticate为 udp- 的本地端口 5000-5010 添加出站允许规则Add rule name="Allow port range" dir=out protocol=udp localport=5000-5010 action=allow

http://www.lryc.cn/news/237748.html

相关文章:

  • [Linux版本Debian系统]安装cuda 和对应的cudnn以cuda 12.0为例
  • NextJS开发:解决React Hook useEffect has a missing dependency
  • 交叉编译tcpdump
  • 万字解析设计模式之 装饰者模式
  • 生成对抗网络Generative Adversarial Network,GAN
  • C++入门第八篇---STL模板---list的模拟实现
  • 论文导读 | 大语言模型与知识图谱复杂逻辑推理
  • 数智竞技何以成为“科技+体育”新样本?
  • Vue项目Jenkins自动化部署
  • 特效!视频里的特效在哪制作——Adobe After Effects
  • 2023年中国醇酸树脂涂料需求量、应用领域及市场规模前景分析[图]
  • 【Linux进阶之路】动静态库
  • Ubuntu磁盘扩展容量
  • 2023年中国羽绒制品需求现状、市场规模及细分产品规模分析[图]
  • 动手学深度学习——循环神经网络的从零开始实现(原理解释+代码详解)
  • 【操作系统】文件系统的逻辑结构与目录结构
  • 局域网内Ubuntu上搭建Git服务器
  • 基础课10——自然语言生成
  • xpath
  • Java拼图小游戏
  • 终于有人把数据资产入表知识地图总结出来了,轻松看懂
  • 白鳝:聊聊IvorySQL的Oracle兼容技术细节与实现原理
  • vue和uni-app的递归组件排坑
  • 【考研】数据结构(更新到顺序表)
  • 汇编-指针
  • 常见Web安全
  • milvus数据库搜索
  • HEVC参考帧技术
  • QT小记:The QColor ctor taking ints is cheaper than the one taking string literals
  • 机器人走迷宫问题