November 2009 Archives

Configure DHCP options using Netsh

| | No TrackBacks

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

Backing up DHCP database using Netsh

| | No TrackBacks

DHCP service, as any other network services, may require periodic backups. However, in most cases it assumes there's direct access to DHCP server configuration files. That makes such a backup possible only if there're file access permissions.

The task, though, may be solved by means of netsh utility, allowing manual control over server backups creation. By default, Windows DHCP server makes DHCP configuration copies every 60 minutes; however, it can be overridden by manually isuing command like

netsh dhcp server \\servername backup destdir

The above command will initiate creating a regular backup to the specified local directory. In case of server name (or IP address) is not specified, local server is assumed (the computer the command is initiated on).

So, the command like

netsh dhcp server backup C:\Backups\DHCP

will back up DHCP registry configuration to C:\Backups\DHCP\DhchCfg, and back up the DHCP database file (.mdb format) to the C:\Backups\DHCP\new folder. Proper access rights may allow making abckups without giving access to system-related data.

About this Archive

This page is an archive of entries from November 2009 listed from newest to oldest.

June 2009 is the previous archive.

December 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.