The default rules: what Windows ships with

When you enable Remote Desktop on Windows, the system creates firewall rules named like "Remote Desktop - User Mode (TCP-In)" and a UDP sibling. They open port 3389 inbound — and critically, their scope defaults to any IP address. That is the correct default for a home PC on a trusted LAN, and the wrong default for a server with a public IP, where "any" means every scanner on the internet.

The good news: you rarely need to build rules from scratch. The built-in rules are well-formed; the hardening is almost entirely about scope — the tab in the rule's properties where you list which remote IPs the rule applies to. Change the scope from "Any IP address" to "These IP addresses" with your short list, and the same rule that welcomed the world now welcomes only you. Everything below is variations on that one move.

Internet everyone tries 3389 Firewall port 3389 scoped list ✓ your home IP ✓ your VPN range ✗ everyone else
Fig. 1 — A scoped rule turns port 3389 from a public door into a private entrance.

Scoping the built-in rule: the 5-minute fix

This is the procedure to memorize. It needs administrator rights and about five minutes, and it is fully reversible — which matters, because the one real risk is locking yourself out by scoping too tightly.

  1. Note your current public IP first. From the device you connect with, visit any "what is my IP" service and write the address down. This is the address you must not lock out.
  2. Open Windows Defender Firewall with Advanced Security (run wf.msc) on the RDP server and select Inbound Rules.
  3. Locate both Remote Desktop rules. Find "Remote Desktop - User Mode (TCP-In)" and its UDP twin. You must scope both — attackers are happy to use whichever you forget.
  4. Open the Scope tab on the TCP rule. Under "Remote IP address", change "Any IP address" to "These IP addresses" and click Add.
  5. Add your trusted IPs. Enter your current IP, plus your office range or VPN subnet if applicable. Use single addresses where possible and ranges only where you must.
  6. Repeat for the UDP rule with the identical list, then click OK on both.
  7. Test from an allowed IP — your RDP client should connect exactly as before.
  8. Test from a blocked IP — tether your phone or use mobile data (a different IP) and confirm the connection is refused. Only then is the job done.

The dynamic-IP problem (and three solutions)

The most common objection to scoping is: "my home IP changes." True — most residential ISPs rotate addresses. But an unscoped rule is not the answer; these are. Option one: scope to a range. ISPs usually rotate within a predictable block; allowing that /24 or the ISP's published range is vastly tighter than the whole internet, though less precise than a single IP.

Option two: a VPN with a stable IP. Connect through a VPN that gives you a fixed address, then whitelist only that address — your home IP can dance all it likes. This is also the cleanest answer for teams: everyone connects via the company VPN, and the firewall lists one range. Our VPN guide covers the setup. Option three: dynamic DNS plus a scheduled task. Advanced users run a script that resolves their DynDNS hostname and updates the firewall rule when the IP changes. It works, but it is the fiddliest option — prefer the VPN approach if you can.

Building custom rules for special cases

Sometimes the built-in rules are not the right vehicle — for example, when you want different treatment for different sources. The New Inbound Rule Wizard (right-click Inbound Rules → New Rule) lets you build precisely scoped rules: allow TCP 3389 from the office range with no restrictions, allow it from a contractor's IP only during business hours via scheduled enable/disable, or log-and-allow from a monitoring host while denying elsewhere.

When building custom rules, remember the precedence logic: an explicit Block rule beats an Allow rule, and more specific rules should sit where you can find them — name them descriptively ("RDP-Allow-Office-203.0.113.0/24") because six months from now "New Inbound Rule 3" will mean nothing to you. And keep the built-in rules disabled rather than deleted if you replace them; re-enabling is easier than recreating, and Windows updates occasionally expect the originals to exist.

ALLOW Office range 203.0.113.0/24 TCP 3389 ALLOW VPN subnet 10.8.0.0/24 TCP 3389 DENY Everything else all other IPs TCP 3389
Fig. 2 — The classic pattern: narrow allows for known sources, deny for the rest of the world.

Rule patterns for common setups

SituationRule approachNotes
Solo user, stable home IPScope built-in rules to that single IPRe-check the IP every few months; ISPs do change them
Solo user, dynamic home IPWhitelist a VPN's stable IP or subnetCleanest fix; see our VPN guide
Small teamWhitelist the office range + VPN subnetOne rule entry per source; document each
Contractor accessCustom allow rule, disabled when not neededTime-box it: enable Monday, disable Friday
Monitoring probesAllow from the monitor's IP onlyProbes from elsewhere are attackers, not uptime checks

Verifying the door is actually closed

Firewall changes deserve the same negative test as every other security control: prove the bad path fails. From a network outside your allowed list — phone tethered to mobile data is perfect — attempt the RDP connection and confirm it times out or is refused rather than reaching a logon prompt. If you see a username/password prompt from a blocked IP, a rule is still too wide (often the forgotten UDP twin, or a second allow rule from another admin).

For the thorough, an external port scan of your server's public IP should show 3389 as filtered/closed from the open internet. Many free online port-check tools do this in seconds. Run the check from the tool's perspective (the internet at large), not from your whitelisted home IP — scanning from inside the allowed list and declaring victory is the most common self-deception in firewall work.

If you lock yourself out

It happens to everyone once: you scope the rule, your IP changes, and suddenly you are the attacker being blocked. Do not panic and do not start "temporarily" disabling the firewall. If your hosting provider offers an out-of-band console (many do), use it to fix the scope from inside. Otherwise, contact support — this is exactly what 24/7 support is for, and it is included with every RDP Temple plan.

Prevention beats rescue. Before tightening any rule, confirm you have a second path in: the provider console, a VPN with a stable IP already whitelisted, or a scheduled task that re-opens a maintenance window. Write your current public IP on a sticky note (digital or physical) before you start. The five minutes of caution here saves the frantic support ticket later.

One rule to remember: every IP that can reach port 3389 is an IP you are trusting with unlimited password guesses. Keep that list as short as you honestly can — your home, your office, your VPN — and let the firewall silently drop everyone else. It's the closest thing to a free lunch in RDP security.

Ready for your own RDP server?

Full admin access, dedicated IP, 24/7 support and a 3-day money-back guarantee on every plan. Pay by credit/debit card, bank transfer, Bitcoin or altcoins.

Shared Servers$6/mo
Dedicated Server$165/mo
Get Started

3-day money-back guarantee · Instant setup · 30+ server locations · 99% uptime SLA

Windows Firewall RDP Rules: FAQ

Open Windows Defender Firewall with Advanced Security (run wf.msc), select Inbound Rules, and look for "Remote Desktop - User Mode (TCP-In)" and its UDP twin. These built-in rules open port 3389; hardening them is mostly about editing their Scope tab to allow only your trusted IP addresses.

Yes. Windows ships separate inbound rules for TCP and UDP Remote Desktop traffic, and attackers will happily use whichever one you forgot. Scope both rules to the identical list of trusted IPs, and verify both with a negative test from a blocked address.

The cleanest fix is a VPN with a stable IP: connect through it and whitelist only the VPN address, so your home IP can change freely. Alternatives include scoping to your ISP's address range (less precise) or a dynamic-DNS script that updates the rule when your IP changes (fiddliest). Never leave the rule wide open just because the IP moves.

Run a negative test: from a network outside your allowed list (a phone on mobile data works well), attempt the RDP connection and confirm it is refused or times out instead of showing a logon prompt. An external port scan showing 3389 as filtered from the internet is the stronger confirmation.

Use your hosting provider's out-of-band console access if available to fix the rule from inside, or contact support — this is exactly what 24/7 support exists for. To prevent repeats, always keep a second path in (provider console or an already-whitelisted VPN IP) before tightening rules.

No. Firewall scoping massively shrinks who can attempt logons, but everyone on the allowed list — your home network, your office, your VPN — can still guess freely. Keep strong unique passwords, an account lockout policy, and NLA in place behind the firewall. Each layer covers the others' blind spots.