Tag Archives: DHCP Role

Automatic DHCP server Backup

Dynamic Host Configuration Protocol (DHCP) server in organization may require backup and restore dhcp database in event of hardware failure, software failure, migration or in fault configuration change. How many of you guys know that Microsoft automatically backup your dhcp database? Sounds strange right? but yes system automatically backup the DHCP server config. In this post let’s see how we can adjust the default parameters of this automatic backup process.

In my demo I am using a server with windows server 2012 R2 in a domain. It do have DHCP server role installed and configure.

To start the process log in to server as Domain admin or Enterprise admin.
Then Server Manager > DHCP

dhcpbk1

Once mmc load, right click on the server node and click properties.

dhcpbk2

In the new window you can see it shows backup path as C:\Windows\system32\dhcp\backup. This is the default path. But we can change it to local folder or network share. Click on brows to select the new path. In my demo it is set to C:\DHCPBackup. Once path set click on ok.

dhcpbk3

dhcpbk4

System automatically backup the config in every 60 minutes time. But we also can change this schedule as per our requirement.
To do that we need to do some registry key edit. To open the registry mmc, go to Run > regedit

dhcpbk5

Then go to path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters
In there you will be able to see a key called BackupInterval.

dhcpbk6

To edit the value double click on it, and then once open select, decimal value option.

dhcpbk7

As you can see default value is 60, to change it type the value you needs (the value represent the number of minutes) and press ok. In my demo I am going to set for 10 minutes.

Once done we can check the folder path we set to confirm the backup it’s made.

dhcpbk8

If you have any questions feel free to contact me on rebeladm@live.com

STEP-BY-STEP GUIDE TO MIGRATE DHCP FROM WINDOWS SERVER 2003 TO WINDOWS SERVER 2012 R2

Microsoft has already announced that windows server 2003 / windows server 2003 R2 versions support is coming to end in 14th July 2015 (http://support2.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=Microsoft+Windows+Server+2003&Filter=FilterNO ).

It’s no wonder that still organizations using windows server 2003 / windows server 2003 R2 in their infrastructure with different server roles. In last few post I have covered up how we can migrate different server roles from windows server 2003 to latest windows server 2012. This article also a part of the same series and it will explain how we can migrate DHCP server role.

For the demonstration I am using following setup

Server Name

Operating System

Server Roles

Networks

dhcp-2k3.canitpro.local

Windows Server 2003 R2 Enterprise x86

DHCP

Network A – 10.10.10.0

Network B – 172.16.25.0

Network C – 192.168.148.0

CANITPRO-DC2K12.canitpro.local

Windows Server 2012 R2 x64

dhcp-2k3.canitpro.local server currently setup with 3 additional NIC to represent network A,B and C. they have configured with static ip addresses to match with relevant network it belongs to. The DHCP server host different DHCP scopes for each network.

Backup DHCP configuration in windows server 2003 R2

1)    Log in to the windows server 2003 as member of administrator group
2)    Load the DHCP server console Start > Administrative Tools >  DHCP

dhcp1

3)    In here we can see the configured DHCP scopes

dhcp2

4)    Now it’s time to back up the config. To do that open the command prompt using start > run > type cmd and then enter
5)    Then type netsh dhcp server export C:\DHCPbk\dhcpbk.txt all and press enter. In here C:\DHCPbk\dhcpbk.txt is the file path which backup will save in to. It can change according to your requirement.

dhcp3

6)    Now please move file C:\DHCPbk\dhcpbk.txt in to CANITPRO-DC2K12.canitpro.local server which will be configured as new DHCP server ( windows server 2012 R2)

Remove DHCP roles from windows server 2003 R2

Since we no longer need DHCP role running on this server we can go ahead and uninstall the DHCP service.

1)    Log in to the windows server 2003 as member of administrator group
2)    Start > Control Panel > Add or Remove Programs

dhcp4

3)    Then click on “Add/Remove Windows Components”

dhcp5

4)    In next window select “Networking Services” and click on details

dhcp6

5)    From next window de-select the DHCP option and click ok

dhcp7

6)    Then click next to uninstall the DHCP service

It will uninstall the DHCP role from the windows 2003 server.

Install DHCP Role in windows 2012 R2 server

1)    Log in to the windows server 2012 as member of administrator group
2)    Open Server Manager > Add Roles and Features

dhcp8

3)    It will open the wizard and click next to continue
4)    For the installation type select “Role-based or feature-based installation” and click  next
5)    Let the default selection run on server selection and click next to continue
6)    For the server roles select DHCP and it will prompt to add relevant features. Click on “Add features” to add them and next to continue

dhcp9

7)    For the features let it run with default. Click next to continue
8)    Then it will give brief description about DHCP server role and click next to continue

dhcp10

9)    Next window it will give the confirmation and click on install to continue

dhcp11

This will install the DHCP server role in the new server.

Restore DHCP configuration

1)    Log in to the windows server 2012 as member of administrator group
2)    Open Command prompt with Run > cmd
3)    Type netsh dhcp server import C:\DHCPbk\dhcpbk.txt all and press enter. In here C:\DHCPbk\dhcpbk.txt is the backup file we copied from windows 2003 server.

dhcp12

4)    Go to Server manager > tools > DHCP

dhcp13

5)    Right click on the server name > All Task > Restart

dhcp14

6)    Once Restart done we can see all the scopes are visible which was in 2003 server.

dhcp15

7)    We still need to authorize the dhcp server, to do it again right click on server name and select authorize

dhcp16

Now we completed with the restore process and I already can see its issues IP addresses.

dhcp17

if any questions about the post feel free to contact me on rebeladm@live.com
 

Step by Step Guide to install DHCP role and configure

Let’s see how we can configure DHCP server in a Windows Server Environment. For the demo I will be using Windows 2008 R2 Server.

To start first need to log in to the server with administrator privileges. Then start the “server Manager” by clicking on “Server Manager” icon on task bar. Then go to “Roles”

dhcp1

Then click on “Add Roles” option to open Add roles Wizard.

dhcp2

Then it will load the Roles Wizard and select the “DHCP Server” From the list and click next to continue.

dhcp3

Then it will give description about the role. Click next to continue.

dhcp4

Next window is asking to use which interface to serve DHCP clients. If server has multiple NIC with multiple IP you can add them also to serve DHCP clients.

dhcp5

In next window it will give opportunity to add DNS settings that should apply for DHCP clients.

dhcp6

Next window is to define the WINS server details.

dhcp7

In next window we can add the scope, the Starting IP, End IP of the DHCP range, subnet mask, default gateway, leased time etc.

dhcp8

In next Window it can configure to support IPv6 as well.

dhcp9

Then it will give the confirmation window before begin the install. Click on “Install”

dhcp10

Once installation finishes DHCP server interface can open from Start > Administrative Tools > DHCP

dhcp11

Using the DHCP it is possible to even configure multiple Scopes configurations to the network. In a network there can be different network segments. It is waste to setup different DHCP servers for each segment. Instead of that it is possible to create different Scopes to issue DHCP for them.