Managing DHCP in Windows Server 2012

DHCPI talked about installing DHCP in “How to install DHCP on Windows Server 2012?”, and now we mange the installed DHCP.

The first step in managing a DHCP server, is defining a scope. Scope is an IP address range that  the DHCP is responsible for allocation IP settings to the clients. So for creating a scope, follow my well-known GUI and PowerShell methods.

GUI:

  1. Hit Windows key + Run to open the run command, execute dhcpmgmt.msc, DHCP console opens. (You can open it via Server Manager too, but my way is more straight forward.)
  2. Expand your server name, mine is server1.cyrusbesharat.local, right-click IPv4, and click New Scope. (You have the chance to have scope on IPv6 environment too, if there exists IPv6 infrastructure)
  3. New Scope Wizard starts. Click on Next
  4. On Scope Name page, type a name for your scope, e.g. LAN, without any description. Then click Next
  5. On IP Address Range, enter 10.10.10.20 next to Start IP address, and 10.10.10.250 next to End IP address
  6. The Length of 8 and Subnet mask of 255.0.0.0 is automatically set. (And if you have sub netting in your network, configure it as appropriate). Then click Next
  7. In the new window, if you have any exclusions; addresses which you don’t want to be assigned by DHCP, put them here. I don’t have, so click on Next
  8. The default lease duration is 8 days. That is; a client can have the assigned IP address for 8 days. If needed, change it, then click Next
  9. Click Next on the new window to configure DHCP options
  10. On default gateway address, put 10.10.10.254, then click Add. (You can change it according to your own network). Click Next 
  11. On new window, the parent domain of CyrusBesharat.local is entered, and IP address of 10.10.10.1 as my DNS is automatically set. Just click Next
  12. On WINS server page, type the desired name and IP address of WINS server. I don’t use WINS, so I left them blank and hit Next
  13. Click Next to activate scope, then click Finish to complete the new scope wizard

PowerShell:

Execute this below command on PowerShell console:
Add-DhcpServerv4Scope -name "LAN" -StartRange 10.10.10.20  -EndRange 10.10.10.250 -SubnetMask 255.0.0.0
Set-DhcpServerv4OptionValue -DnsDomain CyrusBesharat.local -DnsServer 10.10.10.1 -Router 10.10.10.254

To make sure that you have configured DHCP correctly via PowerShell, just run get-dhcpserverv4scope. The result will show accuracy of your job.

Advertisements

How to install DHCP on Windows Server 2012?

DHCPDynamic Host Configuration Protocol (DHCP) is another important role of every network, because it automates IP assignment and reduces the work of administrators to set IP and it’s related settings on each computer.

First familiarize yourself with enhancements of DHCP in Windows Server 2012 by this Microsoft’s TechNet page, “  What’s New in DHCP “ and then follow the below procedures to install it.

GUI method :

  1. Open Server Manager, on Dashboard, click Add roles and features
  2. On Before You Begin window, click Next
  3. On Installation Type window, select Role-based or feature-based installation, then click Next
  4. On Server Selection page, choose Select a server from the server pool, select your server from the below list, and click Next
  5. On Server Roles window, select DHCP Server, confirm by Add Features, then click Next triple
  6. On Confirmation window, hit Install
  7. Wait for the installation to be finished, then on Results window, click Close
  8. Click Notifications on Server Manager window, and click on Complete DHCP configuration
  9. DHCP Post-Install configuration wizard starts, click on Next
  10. DHCP server should be authorized before it can be functional in a domain, so on Authorization window, provide credentials – that is CYRUSBESHARAT\Administrator or any other domain admin accounts, then click Commit
  11. On Summary page, make sure it is done, then hit Close button
    PowerShell method :
    Open PowerShell console and execute below command :

Install-WindowsFeature DHCP –IncludeManagementTools

In next post, I’ll explain how to configure DHCP server.

%d bloggers like this: