


Synchronizing with the Registry
Another important feature of the active lease dialog box is the Reconcile button, which synchronizes the DHCP database with the Registry. When you click this button, the DHCP database is searched for inconsistent entries IP leases that are shown in the Registry but arent reflected in the DHCP database. Its good practice to run Reconcile after restoring or after a system crash. Reconciling registers the inconsistent IP addresses in the DHCP database of active leases with arbitrary unique identifiers. As clients renew their leases, these identifiers are updated.
Logging and Conflict Detection
The Server/Properties page of DHCP Manager contains two troubleshooting features for DHCP: Logging and Conflict Detection. Logging records DHCP activity to the file dhcpsrv.log, and conflict detection pings an IP address before assigning it to discover whether the IP address is in use. (Conflict detection is an option only when Service Pack 2 or later for NT 4.0 is installed.) Conflict Detection must be enabled to allow the DHCP client to send dhcpdecline messages. Also, only IP addresses that were not given to the client in the last renewal are pinged to check for duplication.
A sample of the logging file from our network is shown in Figure 8.6. For this example, the lease time was set to 1 minute (dont do this in your production network!). Also, for obvious reasons, we partially obliterated the IP address, host name, and MAC address.
Note that although lease time was set to one minute, the logging record shows the renewal process happening every thirty seconds (half of the leases time to live). This interval is consistent with the documentation, which states that the renewal process begins halfway through the lease period.
Errors in DHCP and How to Correct Them
Several errors can occur in your DHCP service. Below we outline some of the problems that can occur with Microsoft DHCP and how to resolve them.
A Full DHCP Database Volume
Youll receive the following error message if the volume that contains the dhcp.mdb file is full:
DHCP Event 1014.
The JET database call returned the following error with a hex data
status of ff fd ff ff (0xfffffdff=-513)
The only way to address this problem is to free up some hard-drive space.
Duplicate IP Addresses
Microsoft DHCP clients using non-Microsoft DHCP servers may receive a Duplicate IP addresses error message. NT Service Pack 2 includes a new packet type (dhcpdecline) that may not be recognized by non-Microsoft DHCP servers. If its not recognized, the IP address wont be marked as bad and may be issued even though it has already been issued to another client.
Restoring a Corrupt DHCP Database File
Youll receive the following error message if a DHCP database file (dhcp.mdb) becomes corrupt.
Event ID: 1014
Source: DhcpServer
Description: The Jet database returned the following Error: 510
(or 1022 or 1850)
The usual culprits for DHCP database corruption are power failures, bad hard drives, and curious users who try to open the dhcp.mdb files using Microsoft Access.
If your DHCP database becomes corrupted, you can fix in in one of several ways, as outlined in the Microsoft Technet CD article How to Restore a Corrupted DHCP Database File (Q173396). For those of you who dont have a copy of this CD or article, what follows is a paraphrase with a few additional steps and clarifications.
The DHCP servers database is contained in the DHCP.mdb file located in the Systemroot\System32\DHCP folder. Most of the information in this file is also found in the Registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCPServer\Configuration
During a normal shutdown, both the Registry key and the database file are backed up. The Registry key backup is made to Dhcpcfg, which for NT 4.0 and earlier is located in %Systemroot%\System32\DHCP\Backup. The database file (DHCP.mdb) for NT 4.0 is stored in %Systemroot%\System32\DHCP\ Backup\Jet\New folder.
You can recover a corrupt database in two ways. You can restore the backup copy of dhcp.mdb from a tape backup or disk. Or you can generate a new dhcp.mdb from the dhcp Configuration Registry key.
The first method is preferred. Both methods require you to reconcile the dhcp.mdb file with the Registry as described above. We give specific steps for each method below.
Before performing either of these procedures, heed the usual warnings about editing the Registry. Make a full backup of the server, including the Registry, before you edit it. Also, back up any files that are open, such as Microsoft Exchange files.
For both procedures, go to the command prompt and type
net stop dhcpserver
to prevent the DHCP service from starting while repairs are under way.
Tip: Jim Kenzig at http://thethin.net has pointed out that you can receive TechNet articles (and others) as e-mail by sending a message to mshelp@microsoft.com. In the Subject line of your message, type the article ID number. For example, to receive Q173396, your subject line should read
Subject: Q173396
You can have multiple articles sent to you in e-mail by typing multiple article ID numbers separated by a comma. For example
Subject: Q173396, Q173399, Q174062
To receive an index of articles, type Index in the Subject line. The MSHelp Index is updated monthly. For more information about MSHelp, see http://support.microsoft.com/support/kb/articles/q183/1/21.asp.
|
Restoring a Backup Copy of the DHCP Database
To restore a backup copy of the DCHP database, follow these steps:
- Move all files (but not subdirectories) in the %Systemroot%\System32\ DHCP folder to another directory. Make sure that the subdirectory structure remains unaltered. Copy all the files in the DHCP, BACKUP, JET, and NEW folders to a different directory and delete the original files.
- From the NEW directory, remove the database file, dhcp.mdb.
- Copy the backup database file into the %Systemroot%\System32\DHCP folder from %Systemroot%\System32\DHCP\backup\jet\new\dhcp.mdb. If this backup file is also corrupt or is inaccessible, copy this file from a tape backup.
- Compress the file using Jetpack.exe. To compress the file, first remove any file called Temp.mdb from the DHCP folder, then type the following at the command prompt:
CD %Systemroot%\System32\DHCP
Net Stop dhcpserver
Jetpack Dhcp.mdb Tmp.mdb
Net Start Dhcpserver
The Net Stop command stops the DHCP service; the Jetpack command compacts the database by copying the file to a temporary database, compacting it, deleting dhcp.mdb, and then renaming tmp.mdb to dhcp.mdb. The Net Start command restarts the DHCP service.
For more information about compressing the file, see Microsoft Technet CD article Q145881 How to Use Jetpack.exe to Compact a Wins or DHCP Database.
- To restore scope and reservation information, you must now restore the dhcpcfg file. Start the Registry editor by typing
Regedt32.exe
from the Run utility and go to the subkey
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration.
You will see a window similar to Figure 8.7..
- To restore configuration information from the backup file, select Restore from the Registry menu, go to the Browse list, and select %SystemRoot%\ System32\DHCP\Backup\Dhcpcfg. Click Yes to confirm the selection.
- Exit the Registry editor and start the DHCP Service from the services icon in the Control Panel or type
net start dhcpserver
at the command prompt.
- Open the DHCP Manager on the server and check to see that the scope information is correct. Select Active Leases, then click Reconcile as described in Synchronizing with the Registry earlier in this chapter. Repeat this procedure for all scopes.
- If you view the Active Leases Property page after reconciling, you will notice that the IP address and the computer name are listed but the unique identifier isnt necessarily the MAC address; it may be an arbitrary number that will be updated as soon as the client renews its lease. If the Registry contains entries not contained in the new dhcp.mdb file, the entries are reconciled in this way. The Registry knows that the lease has been given out but the dhcp.mdb file doesnt know to which client the IP address is assigned.
Generating a New Database File
If you suspect that your backup database file is also corrupt, you can generate a new DHCP database file. Generating a new file is the method of last resort because all current lease information is lost.
- Move all files (but not subdirectories) in the %Systemroot%\system32\ DHCP folder to another directory. Make sure that the subdirectory structure remains unaltered. Copy all the files in the DHCP, BACKUP, JET, and NEW folders to a different directory and delete the original files.
- If you are using NT 4.0, restart the DHCP server. Check to see whether the scope information is missing. If it is, stop the DHCP server and compress the file as outlined in step 4 above.
- Restarting the DHCP service causes the dhcp.mdb database file to be regenerated, but all current active lease information will be lost. To restore the configuration information, reconcile the Registry with the database file as outlined in steps 6 and 7 above.
|
Page: 1, 2, 3, 4 |
next page  |
|
|
|
|