Share via


Netsh Routing IP Autodhcp Context Commands

Applies To: Windows Server 2008, Windows Server 2008 R2

The following commands are specific to the routing IP autodhcp context within the Netsh environment.

To view the command syntax, click a command:

  • dump

  • install

  • uninstall

Add commands

  • add exclusion

Delete commands

  • delete exclusion

Set commands

  • set global

  • set interface

Show commands

  • show global

  • show interface

Netsh commands for routing IP autodhcp

The following entries provide details for each command.

dump

Displays the DHCP allocator configuration of a remote access server in script form.

Syntax

dump

Remarks

  • You can dump the contents of the current configuration to a file that can be used to restore altered configuration settings.

Example

The following commands save the current configuration as a script in the c:\test\autodhcpcfg.dmp file.

  • From the command prompt:

    netsh routing ip authodhcp dump > c:\test\autodhcpcfg.dmp

  • From the netsh routing ip autodhcp context prompt:

    set file open c:\test\autodhcpcfg.dmp

    dump

    set file close

You can use the netsh exec command to run the script created by the netsh dump command.

add exclusion

Adds an IPv4 address exclusion to the DHCP allocator scope.

Syntax

add exclusion

exclusion = ] IPAddress

Parameters

  • exclusion = ] IPAddress
    Required. Specifies an IPv4 address to exclude from the DHCP allocator scope.

Example

To exclude 10.0.0.1 from the addresses that can be allocated dynamically, type:

add exclusion exclusion=10.0.0.1

delete exclusion

Deletes an IPv4 address previously excluded from the DHCP allocator scope.

Syntax

delete exclusion

exclusion = ] IPAddress

Parameters

  • exclusion = ] IPAddress
    Required. Specifies an IPv4 address already excluded from the DHCP allocator scope.

Example

To delete 10.0.0.1 from the list of excluded addresses that cannot be allocated dynamically, type:

delete exclusion exclusion=10.0.0.1

install

Installs the DHCP allocator for IPv4.

Syntax

install

set global

Sets global parameters used to support DHCP allocation.

Syntax

set global

[ [ scopenetwork = ] IPAddressscopemask = ] SubnetMask ]

[ [ leasetime = ] Minutes ]

[ [ loglevel = ] { none | error | warn | info } ]

Parameters

  • scopenetwork = ] IPAddress
    Specifies the IPv4 network address for the DHCP allocator scope.
  • scopemask = ] SubnetMask
    Specifies the subnet mask associated with the IPv4 network address for the scope.
  • leasetime = ] Minutes
    Specifies the lease duration time, in minutes.
  • loglevel = ] { none | error | warn | info }
    Specifies which events should be logged.

    • none specifies that no events related to DHCP allocation should be logged.

    • error specifies that only errors related to DHCP allocation should be logged.

    • warn specifies that only warnings related to DHCP allocation should be logged.

    • info specifies that all events related to DHCP allocation should be logged.

Examples

To set the IP network for DHCP allocation to 10.10.10.0, with an associated scope subnet mask of 255.255.255.0, a lease time of 11520 minutes (8 days), and logging of information for all related events, type:

set global 10.10.10.0 255.255.255.0 11520 info

To adjust only the lease time globally for all scopes on all interfaces to a value of 4320 minutes (3 days), type:

set global leasetime=4320

set interface

Configures DHCP allocator parameters for the specified interface.

Syntax

set interface

name = ] InterfaceName

mode = ] { enable | disable }

Parameters

  • name = ] InterfaceName
    Required. Specifies, by name, the interface on which to configure parameters. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Local Area Connection").
  • mode = ] { enable | disable }
    Required. Specifies whether DHCP allocation is enabled or disabled for the interface.

Example

To enable DHCP allocation for interface Local Area Connection, type:

set interface name="Local Area Connection" mode=enable

show global

Displays the DHCP allocator global configuration.

Syntax

show global

show interface

Displays the DHCP allocator configuration for the specified interface.

Syntax

show interface

name = ] InterfaceName

Parameters

  • name = ] InterfaceName
    Required. Specifies, by name, the interface for which you want to display information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").

Example

To display the DHCP allocator configuration for interface Local Area Connection, type:

show interface name="Local Area Connection"

uninstall

Removes the DHCP allocator for IPv4.

Syntax

uninstall