DHCP reservation is the creation of a special entry on the DHCP server. Thanks to this, the same IP address from the DHCP scope address pool will be issued for a specific device (MAC address). In this article, we’ll look at how to create and manage reservations on a DHCP server running Windows Server 2019.
If some network devices (printers, scanners, workstations) require a permanent IP address (instead of manually setting a static IP address in the device settings), you can reserve an IP address on a DHCP server. In the DHCP server on Windows Server 2019, you can create a reservation from any leased IP address, or manually create a new entry.
Open the DHCP Management Console (System Manager > Tools > DHCP) or simply run the dhcpmgmt.msc command. Expand your DHCP server, select IPv4, then select the scope where you want to manage reservations.
If the DHCP server client already received a dynamic IP address from your DHCP server, you can reserve this address. Go to the Address Leases section, find the DHCP client you need in the list (the fact that this IP address is dynamic is indicated by the presence of a date in the Lease Expiration field), right-click on it, and select Add to Reservation.
You can also create a DHCP reservation manually. To do this, you need to find out the MAC address of the device. In case you use a Windows device, you can find out the MAC address of your network adapter with the command:
In this example, the Physical Address is 08-3E-8E-AA-F3-0D, copy it.
To create a new reservation, right-click the Reservations section in the DHCP console and select New Reservation.
Fill in the following fields in the New reservation window:
- Reservation name: specify the network name of the device;
- IP address: specify the IP address from your DHCP scope that you want to assign to the device;
- MAC address: use the physical device address obtained earlier;
- Descriptions: provide a description of the device (optional).
After you have filled in the fields, click the Add button.
If you entered the MAC address in the wrong format, an error will appear “The Unique Identifier you have entered may not be correct. Do you want to use this Identifier anyway?”. In this case, check the MAC address.
Network clients won’t switch to reserved IP addresses automatically. The client will get a new IP address when trying to renew its current lease, on reboot, or when manually use the ipconfig command:
Ipconfig /release Ipconfig /renew
You can manage your reserved IP addresses in the Reservation section. Here you can delete or change the parameters of any DHCP reservation.
Alternatively, you can create a DHCP reservation from the PowerShell command line. To do this, use the Add-DhcpServerv4Reservation cmdlet.
The following command will reserve the leased IP address for a device that has already received an IP address from your DHCP server:
Get-DhcpServerv4Lease -IPAddress 192.168.1.50| Add-DhcpServerv4Reservation
If you need to create a new DHCP reservation for a specific MAC address, use the command:
Add-DhcpServerv4Reservation -ScopeId 192.168.1.0 -IPAddress 192.168.1.51 - ClientId "08-3E-8E-AA-F3-0D" -Description "Boss_laptop"
To create multiple DHCP reservations in bulk, create a CSV file in the following format:
To create reservations for all devices in this file, run the command:
Import-Csv –Path C:\PS\dhcpreservations.csv | Add-DhcpServerv4Reservation -ComputerName nydhcp.theitbros.com