[英]Add Program Exception to Windows Firewall still does not allow connections
I can't seem the get a program exception to work in Windows Firewall for my DotNet WCF executable. 对于DotNet WCF可执行文件,似乎无法在Windows防火墙中正常工作的程序例外。 I have this command:
我有以下命令:
netsh.exe advfirewall firewall add rule name="MyApp Rule" dir=in action=allow protocol=TCP program="c:\myapp\myapp.exe"
However, I still cannot connect from a remote computer (on the same subnet). 但是,我仍然无法从远程计算机(在同一子网上)进行连接。 It works fine if I specify an exact port number, for example:
如果我指定确切的端口号,则可以正常工作,例如:
netsh.exe advfirewall firewall add rule name="MyApp Rule" dir=in action=allow protocol=TCP localport=12345
I have tried it from both the Command Line and the Firewall Exception GUI. 我从命令行和防火墙例外GUI都尝试过。
I have tried on several different machines with several different operating systems including 2008R2 and 2012R2. 我曾尝试在具有2008R2和2012R2几种不同操作系统的几种不同机器上进行尝试。
Is there some special trick I need to know? 我需要知道一些特殊的技巧吗?
Ok, I learned that the WCF listeners run in the System context not in the application's context so that was the reason specifying the WCF executable did not work. 好的,我了解到WCF侦听器在系统上下文中而不是在应用程序的上下文中运行,因此这是指定WCF可执行文件不起作用的原因。 Interestingly if I specify program=system, that works.
有趣的是,如果我指定program = system,那行得通。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.