• netsh学习


    show allowedprogram –显示被允许的程序配置

    show config - 显示防火墙的配置

    show currentprofile -显示 Windows 防火墙的当前配置文件.

    show icmpsetting -显示 Windows 防火墙中的 ICMP 配置

    show logging -显示 Windows 防火墙中的日志记录配置

    show multicastbroadcastresponse –显示防火墙的组播/广播响应配置

    show notifications -显示 Windows 防火墙中的通知配置

    show opmode -显示 Windows 防火墙中的操作配置

    show portopening -显示 Windows 防火墙中的端口配置

    show service -显示 Windows 防火墙中的服务配置

    show state -显示 Windows 防火墙的当前状态

    当然,如果想精确配置防火墙,请使用如下的命令:

    netsh firewall set allowedprogram 编辑 Windows 防火墙中的允许程序配置

    netsh firewall set icmpsettings 编辑 Windows 防火墙中的 ICMP 配置

    netsh firewall set logging 编辑 Windows 防火墙中的日志记录配置

    netsh firewall set notifications 编辑 Windows 防火墙中的通知配置

    netsh firewall set opmode 编辑 Windows 防火墙中的操作配置

    netsh firewall set portopening 编辑 Windows 防火墙中的端口配置

    netsh firewall set service 编辑 Windows 防火墙中的服务配置

    delete portopening 用于删除现有的基于端口例外。

    delete allowedprogram 用于删除现有的基于程序例外。

    add allowedprogram 用于添加基于程序的例外。

    add portopening 用于创建基于端口的例外。

    Reset 将防火墙配置重置为默认值。

    dump 显示一个配置脚本。

    例子
    进入 Windows 防火墙的全局操作模式,并且打开TCP 80端口允许http访问,
    依次使用命令:
    “ set opmode enable”
    “add portopening TCP 80 "My Web Port"”
    “add portopening protocol=ALL port=53 name=DNS mode=ENABLE scope=CUSTOM”


    打开端口实现文件和打印共享
    需要打开137和138 UDP端口.,139和 445 TCP端口依次使用命令:
    “add portopening UDP 137 blah enable subnet”
    “ add portopening UDP 138 blah enable subnet”
    “add portopening TCP 139 blah enable subnet”
    “add portopening TCP 445 blah enable subnet”

  • 相关阅读:
    conda 环境配置
    刨根问底 | MySQL 是如何利用索引的?
    Linux 服务器进程避免 OOM 的方法
    SQL Server中遇到tempdb突然暴涨怎么办?
    面试官:你能接受加班吗?
    TableLayoutPanel 有关合并单元格
    window批量去除文件名称空格
    第四周预习
    jar打包exe(exe4j)
    狄利克雷过程(Dirichlet Process)
  • 原文地址:https://www.cnblogs.com/sprinng/p/6549860.html
Copyright © 2020-2023  润新知