The DHCP client in Windows 2000 and Windows XP has the ability, in the absence of a DHCP server, to configure an IP address and subnet mask automatically when the client starts on a small private network. This feature is called Automatic Private IP Addressing (APIPA). APIPA assigns a unique address from the range 169.254.0.1 through 169.254.255.254 with the subnet mask of 255.255.0.0.
The DHCP client service uses a two-step process to configure the client with an IP address and other configuration information. Upon installation, the client attempts to locate a DHCP server and obtain a configuration from it. Most TCP/IP networks use DHCP servers that are configured to dispense information to clients on the network. For Windows–based operating systems, if the first attempt to locate a DHCP server fails, the DHCP client configures itself with a selected IP address and APIPA address.
If the DHCP client has previously obtained a lease from the DHCP server and the lease has not expired, the client tries to renew any unexpired lease with the DHCP server. If the client fails to locate any DHCP server, it attempts to ping the default gateway listed in the lease. If this action is successful, the client assumes it has not moved to a different network and uses that lease. The client then seeks to automatically renew the lease when half of the lease time has expired.
If the attempt to ping the default gateway fails, the client assumes that it moved to a network that has no DHCP services available, and it configures itself with an APIPA address. It then automatically keeps trying to locate a DHCP server every five minutes.
Alternate Client Configuration
With DHCP client alternate configuration, administrators can easily move a computer among two or more networks, one configured with static IP addresses and one or more configured with DHCP. Alternate configuration provides simplified computer migration (for example, a laptop) among networks without requiring reconfiguration of network adapter parameters, such as IP address, subnet mask, default gateway, preferred and alternate DNS servers, and WINS servers.
Table 2 shows options that are available for configuring TCP/IP properties for a local area network (LAN) connection.
Table 2. Configuring TCP/IP Properties for LAN Connections
Static IP address configuration
When you click Use the following IP address, you can provide values for static IP address settings, such as IP address, subnet mask, default gateway, preferred and alternate DNS servers, and WINS servers. However, if you click Obtain an IP address automatically to change the configuration of your network adapter to a DHCP client configuration, all static IP address settings are lost. Additionally, if you move the computer and configure it for another network, when you return to the original network you must reconfigure the computer with the original static IP address settings.
Dynamic IP address configuration without alternate configuration
When you click Obtain an IP address automatically, your computer acts as a DHCP client and obtains IP address, subnet mask, and other configuration parameters from your network DHCP server. If the DHCP server is unavailable, the network adapter is configured using IP autoconfiguration.
Dynamic IP address configuration with alternate configuration
When you click Obtain an IP address automatically, click the Alternate Configuration tab, and type an alternate configuration, you can move your computer from one statically configured network (such as a home network) to one or more dynamically configured networks (such as a corporate network) without changing any settings. If a DHCP server is unavailable (for example, when your computer is connected to your home network), the network adapter is automatically configured with your alternate configuration, and the computer functions correctly on the network. When you move the computer back to the dynamically configured network and the DHCP server is available, the network adapter is automatically configured with the dynamic configuration assigned by the DHCP server. The alternate configuration is used only when the DHCP client cannot locate a DHCP server.
DHCP Server Discover Attempts
If you use DHCP without an alternate configuration and the DHCP client cannot locate a DHCP server, IP autoconfiguration is used to configure the network adapter. The DHCP client continues to attempt to discover a DHCP server on the network every five minutes. If a DHCP server is found, the network adapter is assigned a valid DHCP IP address lease.
If you use DHCP with an alternate configuration, and the DHCP client cannot locate a DHCP server, the alternate configuration is used to configure the network adapter. Normally, there are no additional discovery attempts. However, a DHCP server discovery attempt will occur in the following cases:
The network adapter is disabled and then enabled again.
Media (such as network cabling) is disconnected and then reconnected.
The TCP/IP settings for the adapter are changed, and DHCP remains enabled after these changes.
If a DHCP server is found, the network adapter is assigned a valid DHCP IP address lease.
The Netsh DHCP component offers a command-line tool that helps with the administration of DHCP servers and provides an equivalent alternative to console-based management. Command-line management is useful in the following situations:
When managing DHCP servers in wide area networks (WANs), you can more effectively manage across slow-speed network links by using commands in interactive mode at the Netsh command prompt.