Monday, January 13, 2014

How to allow a specific public IP through Windows Firewall

Navigate to Start->Administrative Tools->Windows Firewall with Advanced Security
In left navigation left click Inbound Rules
In the Right navigation left click New Rule…

Click Custom and Next
Click All programs and Next
Select Protocol Type and ports or choose Any and All
Click Next
In Which remote IP addresses does this rule apply to click “These IP addresses” and click Add…
Enter public IP and click OK
Click Next
Click Allow the connection and Next
Choose when rule applies and Next
Give the rule a name and description.  Click Next.
Click Finish.

You can also add a rule from the command line.  The below example adds a rule to allow Remote Desktop services from public IP with the rule name of RDesktopRule.

netsh advfirewall firewall add rule name="RDesktopRule" action=allow remoteip= protocol=TCP dir=in localport=3389