Inbound Firewall Rule Not Allowing Traffic When Program Specified

1

1

I am trying to establish a firewall rule that allows incoming traffic to my application. However, the rule does not appear to be allowing the traffic as desired. I am using netsh to establish the rule, but when I specify the path to my program the rule appears to not allow the traffic as desired.

netsh advfirewall firewall add rule name="My Application Rule" 
    program="C:\Program Files (x86)\MyComp\MyApp\MyApp.exe" dir=in action=allow
    protocol=TCP localport=7890-7894

When I do not specify the program the traffic is allowed, however, this is not desired because it'll allow traffic to any application listening on those ports.

netsh advfirewall firewall add rule name="My Application Rule" dir=in
    action=allow protocol=TCP localport=7890-7894

JG in SD

Posted 2014-02-18T17:37:49.370

Reputation: 111

Take note that if you are using GUI for this task, it's either localport or program, not both. – Kitet – 2014-02-18T20:23:27.853

@Kitet I have used both the GUI and command line to add the desired rule with the same results each time. – None – 2014-02-18T20:39:52.883

So MyApp.exe is certainly not the right App. It could be a sub-process of MyApp.exe. What is MyApp.exe ? a real App or a custom dev ? You could check what happens with Wireshark. – user2196728 – 2014-02-18T23:44:09.477

@user2196728 MyApp.exe is a .NET application that I work on. My end goal is to figure out what commands I need to run via the command line in the installer, so network traffic can reach the program without an administrator needing to configure the firewall manually. – None – 2014-02-19T02:43:10.173

No answers