frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

[Windows] How to grant access to Windows Server by IP or IP range

EugeneEugene Moderator

Introduction

Granting access to a Windows Server based on IP or IP range is essential for security and control. By limiting access to specific addresses, you can prevent unauthorized users from connecting while ensuring that only trusted devices can interact with the server.
This method is commonly used in remote desktop access, web servers, and database connections.

What is an IP Address and IP Range?

An IP (Internet Protocol) address is a unique identifier assigned to each device on a network. It can be either:

  • IPv4 (e.g., 192.168.1.1)
  • IPv6 (e.g., 2001:db8::ff00:42:8329).

An IP range refers to a set of IP addresses within a specific range, allowing multiple addresses to be included in one rule, such as 192.168.1.1 - 192.168.1.255.

How to Find Your IP Address

Public IP: Visit a website like https://whatismyipaddress.com/.

Local IP (Windows):
Open Command Prompt and run: ipconfig
Look for "IPv4 Address" under your active network adapter.

(Linux/MacOS)
Open Terminal and run: curl ifconfig.me
It will provide you your Public Ipv4 address

Granting access in Windows server by IP address

  1. Connect to your Windows server via RDP
  2. Open Windows Defender Firewall with Advanced Security (wf.msc in Run dialog Win + R).

  1. Click Inbound Rules.
  2. Find Rule named "Remote Desktop - User Mode (TCP-In)" (Press "R" key on keyboard to navigate faster).
  3. Double click on the Rule to open it's properties.
  4. Select tab named "Scope".
  5. In section "Remote IP address" choose "These IP addresses" and click "Add":

  1. In new opened window you can choose to either allow:
  • One IP address;
  • Subnet;
  • IP range.
  1. Press OK to apply changes.

How to Check if Rules Work

The simplest way to check if the rules are working is to connect from a different IP address that you have applied in the rules. If the device cannot connect to the server, it means the rules are blocking it.

Conclusion

By implementing IP-based access control, we have enhanced the security of the Windows Server by allowing only trusted IPs or ranges to connect. This ensures that unauthorized users are blocked while legitimate access remains uninterrupted.

Comments

Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2025 Time4VPS. All rights reserved.

Get In Touch