Windows firewall basics
Kort antwoord
Windows Defender Firewall is built into Windows Server. Open it via the Start menu, use Allow an app or feature for common cases, or Advanced settings to write specific inbound and outbound rules.
The steps below apply to current Windows Server releases. Menu names and dialogs are consistent across recent versions, so the same steps work whichever supported release you're running.
Navigating to the firewall
Open Windows Defender Firewall
Search for "Windows Defender Firewall" from the Start menu and open it.
Review the current status
The main screen shows whether the firewall is active for each network profile (domain, private, public).
Allow an app or feature quickly
For common services, use Allow an app or feature through Windows Defender Firewall rather than writing a manual rule.
Use Advanced settings for manual rules
Select Advanced settings to create specific inbound and outbound rules by port, program, or scope.
Secure your RDP connection
Open Advanced settings, then Inbound Rules
Find the Remote Desktop rule
Locate "Remote Desktop - User Mode (TCP-In)" in the list.
Restrict the scope
Open the rule's properties, go to the Scope tab, and use Add under "Remote IP address" to limit RDP access to specific, trusted IP addresses.
Add a rule for a specific port
Open Inbound Rules
From Advanced settings, select Inbound Rules, then New Rule in the right-hand panel.
Choose Port
Select Port as the rule type, choose TCP (or UDP if needed), and specify the port number.
Allow the connection and name the rule
Select Allow the connection, choose which network profiles it applies to, then give the rule a descriptive name so it's easy to find later.