Step 1: Open the Windows Firewall with Advanced Configuration
Step 2: Locate the Remote Desktop rule that’s currently enabled and edit it.
Step 3: In the Scope tab, change the allowed Remote IPs field to whatever you want. This is the source address that you wish to restrict.