命令行下开启与关闭windows防火墙关端口(转)

您所在的位置:网站首页 怎么用防火墙关闭端口 命令行下开启与关闭windows防火墙关端口(转)

命令行下开启与关闭windows防火墙关端口(转)

2024-07-11 07:26| 来源: 网络整理| 查看: 265

sc config sharedaccess start= auto //设置防火墙服务为自动

net start sharedaccess //开启防火墙服务

 

关闭端口

netsh firewall add portopening protocol = TCP port = 139 name = "关闭139" mode = DISABLE

netsh firewall add portopening protocol = TCP port = 445 name = "关闭445" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 137 name = "关闭137" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 138 name = "关闭138" mode = DISABLE 

 

开启端口

netsh firewall add portopening protocol = TCP port = 139 name = "开启139" mode = ENABLE

netsh firewall add portopening protocol = TCP port = 445 name = "开启445" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 137 name = "开启137" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 138 name = "开启138" mode =  ENABLE



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3