netsh firewall show allowedprogram //查看防火墙放行的程序
netsh firewall set portopening TCP 445 ENABLE //打开445端口
netsh firewall set portopening TCP 3389 ENABLE //放行终端
netsh firewall delete allowedprogram C:\A.exe //删除放行程序A.exe
netsh firewall set allowedprogram C:\A.exe A ENABLE //添加程序C盘下的A.exe并放行
netsh firewall add allowedprogram C:\A.exe A ENABLE //添加程序C盘下的A.exe并放行
set allowedprogram和add allowedprogram效果一样都可以添加放行程序?
小玩一下,允许或拒绝某台IP不能访问远程端口,netsh firewall set portopening TCP 3389 远程桌面 enable/disable custom 192.168.10.100,也可以设置一个网段:IP/24
SQL2008开启防火墙设置:
netsh firewall set portopening TCP 1433 SQLServer
netsh firewall set portopening TCP 1434 SQL Admin Connection
netsh firewall set portopening TCP 4022 SQL Server Broker
netsh firewall set portopening TCP 135 SQL Debugger/RPC
netsh firewall set portopening TCP 2383 SAnalysis Services
netsh firewall set portopening TCP 2382 SQL Browser
netsh int ip reset c:\resetlog.txt 重装TCP/协议并保存日志记录至C盘