Saturday, December 10, 2011

Debugging DHCP on the client

In case a computer has problem with DHCP, there is a special log within Windows 7 that can help you a lot.

Go to Event Viewer, Applications and Services Logs, Microsoft, Windows, Dhcp-Client, Microsoft-Windows-DHCP Client Events/Operational.

By default this trace log will be empty, because you need to enable it by clicking on “Enable log” on the right side.

Eventviewer

It can help you a lot to analyze the problems the computer might have, but there is one little thing that can drive you nuts at first.

The log will not reveal about which network connection the event is, it will only tell you about Adapter X or Interface X:

Inform ack is received in the adapter 10.

Dhcp has notified NLA for the configuration changes for the interface 10

The events are referring to an internal Windows index that identifies each network connection which is called Interface Index. You can use the netsh command to get the interface index (First column, “Idx”)

netsh interface ipv4 show interface

NetSH

You can also use wmic to display the interface index:

wmic nic get name, index, DeviceID, NetConnectionStatus, InterfaceIndex

WMIC

5 comments:

  1. This is so useful but so easy to miss! I never knew you had to enable certain logs... thanks a lot!

    ReplyDelete
  2. Thank you, really useful. But note, the maximum log size and rotation policy. By default max. size = 1028 KB, and policy = Overwrite old events. So if You try to monitor some long events - You have to change log size or log policy.

    ReplyDelete
  3. Thanks a lot for this help

    ReplyDelete