Netsh Routing IP Autodhcp Context Commands
Updated: June 3, 2009
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:
Add commands
Delete commands
Set commands
Show commands
The following entries provide details for each command.
Displays the DHCP allocator configuration of a remote access server in script form.
dump
-
You can dump the contents of the current configuration to a file that can be used to restore altered configuration settings.
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.
Adds an IPv4 address exclusion to the DHCP allocator scope.
add exclusion
[ exclusion = ] IPAddress
- [ exclusion = ] IPAddress
- Required. Specifies an IPv4 address to exclude from the DHCP allocator scope.
To exclude 10.0.0.1 from the addresses that can be allocated dynamically, type:
add exclusion exclusion=10.0.0.1
Deletes an IPv4 address previously excluded from the DHCP allocator scope.
delete exclusion
[ exclusion = ] IPAddress
- [ exclusion = ] IPAddress
- Required. Specifies an IPv4 address already excluded from the DHCP allocator scope.
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
Sets global parameters used to support DHCP allocation.
set global
[ [ scopenetwork = ] IPAddress [ scopemask = ] SubnetMask ]
[ [ leasetime = ] Minutes ]
[ [ loglevel = ] { none | error | warn | info } ]
- [ 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.
- none specifies that no events related to DHCP allocation should be logged.
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
Configures DHCP allocator parameters for the specified interface.
set interface
[ name = ] InterfaceName
[ mode = ] { enable | disable }
- [ 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.
To enable DHCP allocation for interface Local Area Connection, type:
set interface name="Local Area Connection" mode=enable
Displays the DHCP allocator global configuration.
show global
Displays the DHCP allocator configuration for the specified interface.
show interface
[ name = ] InterfaceName
- [ 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").
To display the DHCP allocator configuration for interface Local Area Connection, type:
show interface name="Local Area Connection"
