Modify the subnet mask of a DHCP scope on Windows Server

Windows Server 2012R2  Windows Server 2016  Windows Server 2019

Introduction

In this tutorial, we will see how to modify the subnet mask of a DHCP scope on Windows Server.

If we look in the properties of the scope, we realize that it is not possible to modify the subnet mask.

Propriétés étendue DHCP

The “modification” of the DHCP scope is done in several stages:

  • Exporting the DHCP scope configuration
  • Modification of the configuration with the new subnet mask
  • Deleting the DHCP scope
  • Importing the configuration

Preparation

Before modifying the scope and the subnet mask, the change must be prepared.

The first step is to validate the new scope and make sure that the change of subnet mask will not collide with an existing scope.

If we take the example of the range 172.16.123.0/24, which limits the number of addresses available to 254 and we want to double the number of addresses available, we will therefore switch to a mask in / 23 which will give the range 172.16.122.0 – 172.16.123.255 and not the range 172.16.123.0 – 172.16.124.255.

To guide you in calculating the IP range, several calculators are available on the Internet:

  • List the equipment with fixed IP addresses to change the subnet mask.
  • Check the routing equipment (Routers / Switchs / Firewall ….).
  • Reduce the duration of DHCP leases on the beach.
  • Schedule the change at a time when the load is light.

Modify the subnet mask

Manipulations are to be done from the Powershell command prompt in administrator, you can either use Powershell cmdlets or the netsh utility.

If Windows is in a language with accented characters, it is imperative to use a PowerShell command prompt even for netsh commands, the export of the configuration contains accented characters which are not supported by a command prompt classic.

Manipulations are to be done on the DHCP server.

Export the scope configuration

Netsh :

PowerShell :

Modify the scope configuration

Netsh : open the configuration file and modify the scope mask, then save the modifications.

PowerShell: open the configuration file and modify the scope mask, then save the modifications.

Delete scope

You must now delete the scope of the server before importing the modified configuration file.

Right click on the range 1 and click on Delete 2.

Import new scope configuration

Netsh :

PowerShell :

Confirm the import by confirming the action.

Validate the import of the scope

Check in the console that the scope is imported.

Check in the properties that the new mask is properly applied.

Conclusion

If you are using a DHCP failover configuration, you must reconfigure the scope failover.

All you have to do is modify the equipment with a fixed configuration.





Related Posts


DNS Resolution Based on Client IP Address with Windows Server

In this tutorial I will explain how to make sure that the DNS resolution with Windows Server is done according to the IP address of the client. There are two solutions that we will see in this article

How to install and configure Windows server routing

In this tutorial, I will explain how to set up routing with Windows Server. I regularly use this role in the different labs that I put in place under Hyper-V. I isolate the test platform with a privat

Active Directory: Multi Site, Subnet, and Replication Configuration

Presentation In this tutorial, we will approach the notions of Active Directory sites as well as subnets. Active Directory sites can optimize management in multi-site / network infrastructures by: Man