For example, here I am opening ports 600o to 7000 for UDP outbound traffic: netsh advfirewall firewall add rule name="UDP ports" protocol=UDP dir=out localport=6000-7000 action=allow If you need to open up a range of ports, just use a simple dash. If you were to run this command, then go view the allowed apps in Windows Firewall, you would see that the Remote Desktop item is now checked: You add a rule, give it a name, choose the protocol (TCP or UDP), choose the direction (In or Out), give it the port number and choose the action (Allow or Deny). The command is quite long, but it’s fairly easy to break down. You would simply run this command: netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow Let’s say you want to open port 3389, which is for remote desktop in Windows. Now what if you want to open a port in the firewall using the command line? That’s simple too! To enable again, just put on at the end instead of off. So if you wanted to disable the firewall completely, you would use allprofiles instead of privateprofile. The other options are currentprofile, publicprofile, domainprofile, and allprofiles. ![]() To disable the firewall for a specific profile, you would use the following command: netsh advfirewall set privateprofile state off The Firewall Policy tells you what inbound and outbound policies are being applied to each profile. ![]() State means if the firewall is turned on or off.
0 Comments
Leave a Reply. |