共用方式為


Netsh Commands for Dynamic Host Configuration Protocol client

Applies To: Windows Server 2008

The Netsh commands for Dynamic Host Configuration Protocol (DHCP) client offer a command-line tool that helps with the administration of DHCP clients.

Netsh commands for DHCP client

You can run these commands from the command prompt for the Netsh DHCP context. For these commands to work at the command prompt, you must type netsh dhcp before typing commands and parameters as they appear in the syntax below.

For an example of how to use Netsh commands for DHCP in batch files and scripts, see Netsh DHCP Example.

For more information about netsh, see Netsh Overview and Enter a Netsh Context.

Netsh DHCP client

The following commands are available at the dhcpclient> prompt, which is rooted within the netsh environment.

trace

Specifies whether logging, which is also called tracing, is enabled or disabled for the DHCP client on the local computer.

Syntax

trace { enable | disable }

Parameters

  • Enable
    Optional. Specifies that logging is enabled for the DHCP client service on the local computer. If the DHCP Network Access Protection (NAP) Enforcement Client is enabled, NAP events are also logged.
  • Disable
    Optional. Specifies that logging is disabled for the DHCP client service on the local computer. If the DHCP NAP Enforcement Client is enabled, logging of NAP events is also disabled.

Example

The following example enables tracing for the DHCP client service and the DHCP NAP Enforcement Client:

netsh dhcpclient trace enable