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
In Which remote IP addresses does this rule apply to click “These IP addresses” and click Add…
Enter public IP and click OK
Click Allow the connection and Next
Choose when rule applies and Next
Give the rule a name and description. Click Next.
You can also add a rule from the command line. The below example adds a rule to allow Remote Desktop services from public IP 126.96.36.199 with the rule name of RDesktopRule.
netsh advfirewall firewall add rule name="RDesktopRule" action=allow remoteip=188.8.131.52 protocol=TCP dir=in localport=3389