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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: