DHCP configuration can be changed not only from default configuration GUI-type application, but also from command line. This is especially useful when applying dynamic changes to DHCP, for testing or other purposes.
It can also be used by unattended DHCP control (e.g., to force DHCP server to provide certain given parameters such as gateway address) to the served network.
DHCP options that can be configured from command-line are pieces of additional information the DHCP server provides to clients leasing addresses. They can be configured at server, scope or reservation level.
To configure a scope option that makes IP 10.50.10.1 the default gateway address to clients that request addresses from the 10.50.10.0 scope, use the following command:
netsh dhcp server scope 10.50.10.0. set optionvalue 003 IPADDRESS 10.50.10.1
After issuing the command, verify the result:
netsh dhcp server scope 10.50.10.0 show optionvalue
To assign the option at the server level rather than at the scope level, use the following command instead:
netsh dhcp server 10.50.10.0 set optionvalue 003 IPADDRESS 10.50.10.1