Reserving IP Addresses on a Freshly Set Up DHCP Server in Windows Server 2022
In a Windows Server 2022 environment, a Dynamic Host Configuration Protocol (DHCP) server is used to dynamically assign IP addresses to devices on a network. In some cases, you may want to reserve a specific IP address for a particular device. This is known as an IP reservation. In this article, we will cover the steps to create an IP reservation on a freshly set up DHCP server in Windows Server 2022.
Prerequisites
Before you can create an IP reservation, you need to have a DHCP server set up and running on your Windows Server 2022. Additionally, the devices for which you want to reserve IP addresses should not yet be connected to the network.
Creating an IP Reservation
To create an IP reservation, follow these steps:
- Open the DHCP console on your Windows Server 2022.
- In the console tree, expand the IPv4 node and then select the DHCP server that you want to configure.
- From the Action menu, select "New Reservation" to open the New Reservation dialog box.
- In the IP Address field, enter the IP address that you want to reserve. This must be a valid IP address within the scope of the DHCP server.
- In the Description field, enter a description for the reservation. This can be used to identify the reservation later.
- In the "Hardware Address" field, enter the MAC address of the device for which you want to reserve the IP address. This can be found in the device's network settings.
- Click "Add" to add the reservation to the DHCP server.
Verifying the IP Reservation
To verify that the IP reservation has been created correctly, you can use the "ipconfig /all" command on the device for which you reserved the IP address. This will display the IP configuration of the device, including the IP address and the MAC address. The IP address should match the one that you reserved on the DHCP server, and the MAC address should match the one that you entered when creating the reservation.
Inactive Reserved IP Address Used by Another Device
If you encounter an issue where an inactive reserved IP address is being used by another device, it is likely that the device was connected to the network before the reservation was created. In this case, the device may have already been assigned the reserved IP address by the DHCP server. To resolve this issue, you can release the IP address on the device and then renew the IP address. This will allow the DHCP server to assign the reserved IP address to the correct device.
In this article, we covered the steps to create an IP reservation on a freshly set up DHCP server in Windows Server 2022. We also discussed how to verify the IP reservation and troubleshoot issues with inactive reserved IP addresses being used by other devices. By following these steps, you can ensure that specific IP addresses are reserved for specific devices on your network.
References
// Example code block in PowerShell
$dhcpServer = [Microsoft.Dhcp.DhcpServer2012R2]::GetDhcpServer("DC01")
$scope = $dhcpServer.Scopes | Where-Object {$_.IPAddress -eq "10.0.0.0"}
$reservation = $scope.Reservations.Add("Client01", "00-11-22-33-44-55")
$reservation.IPAddress = "10.0.0.100"
$reservation.Description = "Reservation for Client01"
$reservation.Update()