How to enable inbound connection on Windows 7 firewall for a program?

0

I have two computers on my network: one Linux machine and one Windows 7 machine.

I run a

nc -l 8888

on the Windows 7 machine and I run a

nc -nv 8888

on my Linux machine to connect to my Windows 7 machine. But it doesn't work.

It works when I totally disable my firewall on the Windows 7 machine. How can I just add the specific rule for the nc my Windows machine?

For now I went to the firewall settings and created a rule for the netcat executable. I've also created a rule for the port 8888, outbound and inbound.

But it's still not working.

Robert Reynolds

Posted 2018-06-10T14:09:07.240

Reputation: 141

What have you tried and what isn't working? There are dozens of tutorials on the Internet for this specifically, and even a guide in Windows Help, to walk you through the process of opening a port in the Windows Firewall... If you have done any research on your own, let us know what you did and what didn't work. Superuser is not a site to hold your hand. :) – acejavelin – 2018-06-10T14:56:58.967

I went to the firewall settings and created a rule for the netcat executamble. I've also created a rule for the port 8888, outbound and inbound. – Robert Reynolds – 2018-06-10T15:02:04.320

Can you append the relevant entries from the Window's firewall log? It is located at %systemroot%\system32\LogFiles\Firewall\pfirewall.log – acejavelin – 2018-06-10T15:04:57.267

@BobReynolds - Try running from elevated command prompt: netsh advfirewall firewall add rule name="NetCat Inbound" dir=in action=allow program="C:\path\netcat,exe" remoteip=any localip=any protocol=TCP localport=8888 remoteport=8888 profile=any so you create a rule for both the exe, the port, allow access from any local or remote IP, and also from any network profile classification. Adjust the value for the full path to the NC executable file though, but this should resolve the problem for you. – Pimp Juice IT – 2018-06-10T15:45:30.877

You likely just needed to add the local and remote IP addresses you allow to connect to it and to tell it what network adapter trust level /scope connections you allow to connect through it so any is like saying public,private,domain—you could be more explicit if you need and the same with the local and remote IP for just the subnet range you need. – Pimp Juice IT – 2018-06-10T15:47:22.193

No answers