Showing posts with label DHCP. Show all posts
Showing posts with label DHCP. Show all posts

Wednesday, February 24, 2016

Quasi-Failover DHCP 2008 R2

I was given a client recently that was running out of IP addresses on their DHCP server. 

After some investigation I discovered that they had 2 DHCP server on the same AD and on the same network. Let say the network is 192.168.1.0, it had a subnet mask of 255.255.0.0. No really it does have that subnet mask. Anyways, the 2 DHCP servers are giving out the same scope of 192.168.1.1 - 192.168.1.254. DHCP1 was giving an exclusion of 192.168.1.1 - 192.168.1.170 and DHCP2 had an exclusion of 192.168.170 - 254. Of course there were other exclusions for servers and printers but you get the point. 

After looking a little bit deeper I noticed that the DHCP1 server was not giving out any leases. This didn't make sense until I fully thought about what was happening here. 

The reason DHCP2 server was the only one giving out IP addresses is because it is, for lack of a better term, faster. The reason is because once a machine has made contact with a DHCP server, even if it’s out of addresses, it will NOT try a different DHCP server. It will keep  trying that same DHCP server for an address. This is why the DHCP1 is not giving out leases, its to slow to answer. 

So, since DHCP2 is always the fastest, it always replies first, even if its full. The one way of testing, and verifying, this is to turn off the DHCP2 services on DHCP2, momentarily, and do a request for an address from a device. Then look at DHCP1 to see if it gave out the address to that device. Of course we tested this and it worked as I expected. 

Doing an “ipconfig /release” and then an “ipconfig /renew” on a computer would give you the request needed for testing. I would not do this on a computer that already has an address that you need to use to turn the DHCP services back on, maybe do this on a temp PC.

So basically in this configuration there is a quasi-failover DHCP system in place. If DHCP2 is offline then DHCP1 would pick up and start handing out addresses. Of course this is not the best way to setup a failover DHCP environment, but, it kinda works. Here is the correct way:

I hope this helps someone in their endeavour of trying to figure out why a DHCP might not be giving out leases. 

Thursday, May 9, 2013

DHCP server settings from a 2003 to a 2008 server

Issue: 

Need to move DHCP server settings from a 2003 server to a 2008 server.

Solution:

I know there is a way to do this using netsh Will list info on that.

How is it going to work:

Dump the database from old server to a file.
Transfer that file to the new server.
Import the old DB in to the DHCP DB.

The work: 

  •  I used the Microsoft Article ID: 962355
    • http://support.microsoft.com/kb/962355
      • Here are the steps I followed them.
        • Export the DHCP database from Windows 2003:

          1.                   On the Windows 2003 DHCP server, navigate to a command prompt

          2.                   Type the following Command: netsh

          3.                   Type the following Command: DHCP

          4.                   Type the following Command: server <\\Name or IP Address>

          5.                   Type the following Command: export c:\w2k3DHCPdb all

          Note You must have local administrator permissions to export the data.

          Import the DHCP database

          1.       Copy the exported DHCP database file to the local hard disk of the Windows Server 2008-based computer.

          2.       Install the DHCP Role on the server.

          3.       Stop the DHCP server service on the server.  To do this, follow these steps:

          a.       Log on to the target DHCP server by using an account that is a member of the local Administrators group.

          b.      Click Start, click Run, type cmd in the Open box, and then click OK.

          c.       At the command prompt, type net stop DHCPserver , and then press ENTER. You receive a "The Microsoft DHCP Server service is stopping. The Microsoft DHCP Server service was stopped successfully" message.

          d.      Type exit, and then press ENTER.

          4.       Delete the DHCP.mdb file under c:\windows\system32\DHCP folder.

          5.       Start the DHCP server service.

          6.       Right-click on the Command Prompt (cmd) and select run as administrator, to open the cmd prompt using elevated privileges.

          Note You must have local administrator permissions to import the data.

          7.       Type the following Command: netsh

          8.       Type the following Command: DHCP

          9.       Type the following Command: server <\\Name or IP Address>

          10.   Type the following Command: import c:\w2k3DHCPdb

          11.   Restart DHCP and verify the database has moved over properly.  
    • To verify the new server worked, after the old server was off, I released my DHCP lease.
      • cmd (with admin privileges)
        • ipconfig /release
    • Then I renewed the IP Address
      • cmd (with admin privileges)
        • ipconfig /renew
    • Now I made sure the new DHCP server was there.
      • cmd (with admin privileges)
        • ipconfig /all
          • Look for the DHCP server that gave the new lease.

The Result

The longest part of this job was building up the new server. This was a cake job after getting all the steps in front of me.