Windows 7 / Networking

DHCP

Almost all client computers should be configured using DHCP. With DHCP, you configure a DHCP server (such as a computer running Windows Server 2003) to provide IP addresses and network configuration settings to client computers when they start up. Windows 7 and all recent Windows operating systems are configured to use DHCP by default, so you can configure network settings by simply setting up a DHCP server and connecting a computer to the network.

As the number of mobile computers, traveling users, and wireless networks has increased, so has the importance of DHCP. Because computers may have to connect to several different networks, manually configuring network settings would require users to make changes each time they connected to a network. With DHCP, the DHCP server on the local network provides the correct settings when the client connects.

Some of the configuration settings you can configure with DHCP include the following:

  • IP address Identifies a computer on the network
  • Default gateway Identifies the router that the client computer will use to send traffic to other networks
  • DNS servers Internet name that servers use to resolve host names of other computers
  • WINS servers Microsoft name that servers use for identifying specific computers on the network
  • Boot server Used for loading an operating system across the network when configuring new computers or starting diskless workstations

Clients use the following process to retrieve DHCP settings:

  1. The client computers transmit a DHCPDiscover broadcast packet on the local network.
  2. DHCP servers receive this broadcast packet and send a DHCPOffer broadcast packet back to the client computer. This packet includes the IP address configuration information. If more than one DHCP server is on the local network, the client computer might receive multiple DHCPOffer packets.
  3. The client computer sends a DHCPRequest packet to a single DHCP server requesting the use of those configuration settings. Other DHCP servers that might have sent a DHCPOffer broadcast will see this response and know that they no longer need to reserve an IP address for the client.
  4. Finally, the DHCP server sends a DHCPACK packet to acknowledge that the IP address has been leased to the client for a specific amount of time. The client can now begin using the IP address settings.

In addition, client computers will attempt to renew their IP addresses after half the DHCP lease time has expired. By default, computers running Windows Server 2003 have a lease time of eight days. Therefore, client computers running Windows attempt to renew their DHCP settings after four days and will retrieve updated settings if you have made any changes to the DHCP server.

Because client computers retrieve new DHCP settings each time they start up, connect to a new network, or a DHCP lease expires, you have the opportunity to change configuration settings with only a few days' notice. Therefore, if you need to replace a DNS server and you want to use a new IP address, you can add the new address to your DHCP server settings, wait eight days for client computers to renew their DHCP leases and acquire the new settings, and then have a high level of confidence that client computers will have the new server's IP address before shutting down the old DNS server.

If a client computer does not receive a DHCP address and an alternate IP address configuration has not been manually configured, Windows client computers automatically configure themselves with a randomly selected Automatic Private IP Addressing (APIPA) address in the range of 169.254.0.1 to 169.254.255.255. If more than one computer running Windows on a network has an APIPA address, the computers will be able to communicate. However, APIPA has no default gateway, so client computers will not be able to connect to the Internet, to other networks, or to computers with non-APIPA addresses.

You can use the following techniques to determine whether a client has been assigned an IP address and to troubleshoot DHCP-related problems:

  • IPConfig From a command line, run IPConfig /all to view the current IP configuration. If the client has a DHCP-assigned IP address, the DHCP Enabled property will be set to Yes, and the DHCP Server property will have an IP address assigned, as the following example demonstrates.
    Note If you are troubleshooting a client connectivity problem and notice that the IP address begins with 169.254, the DHCP server was not available when the client computer started. Verify that the DHCP server is available and the client computer is properly connected to the network. Then, issue the ipconfig /release and ipconfig /renew commands to acquire a new IP address.
  • Network And Sharing Center In Network And Sharing Center, click the name of the connection (such as Local Area Connection) to open the connection status. Then, click Details to open the Network Connection Details dialog box. This dialog box provides similar information to that displayed by the IPConfig /all command.
  • Event Viewer Open Event Viewer and browse the Windows Logs\System Event Log. Look for events with a source of Dhcp-Client for IPv4 addresses or DHCPv6-Client for IPv6 addresses. Although this technique is not useful for determining the active configuration, it can reveal problems that occurred in the past.
[Previous] [Contents] [Next]

In this tutorial:

  1. Configuring Windows Networking
  2. Usability Improvements
  3. Network And Sharing Center
  4. Network Explorer
  5. How Windows Finds Network Resources
  6. How Windows Publishes Network Resources
  7. How Windows Creates the Network Map
  8. Network Map
  9. Set Up A Connection Or Network Wizard
  10. Manageability Improvements
  11. Network Location Types
  12. Policy-Based QoS
  13. Selecting DSCP Values
  14. Planning Traffic Throttling
  15. Configuring QoS Policies
  16. Configuring System-Wide QoS Settings
  17. Configuring Advanced QoS Settings
  18. Testing QoS
  19. Windows Firewall and IPsec
  20. Windows Connect Now in Windows 7
  21. Core Networking Improvements
  22. Networking BranchCache
  23. How Hosted Cache Works
  24. How Distributed Cache Works
  25. Configuring BranchCache
  26. BranchCache Protocols
  27. File Sharing Using SMB
  28. Web Browsing with HTTP (Including HTTPS)
  29. DNSsec
  30. GreenIT
  31. Efficient Networking
  32. What Causes Latency, How to Measure It, and How to Control It
  33. TCP Receive Window Scaling
  34. Scalable Networking
  35. Improved Reliability
  36. IPv6 Support
  37. 802.1X Network Authentication
  38. Server Message Block (SMB) 2.0
  39. Strong Host Model
  40. Wireless Networking
  41. Improved APIs
  42. Network Awareness
  43. Improved Peer Networking
  44. Services Used by Peer-to-Peer Networking
  45. Managing Peer-to-Peer Networking
  46. Peer-to-Peer Name Resolution
  47. EAP Host Architecture
  48. Layered Service Provider (LSP)
  49. Windows Sockets Direct Path for System Area Networks
  50. How to Configure Wireless Settings
  51. Configuring Wireless Settings Manually
  52. Using Group Policy to Configure Wireless Settings
  53. How to Configure TCP/IP
  54. DHCP
  55. Configuring IP Addresses Manually
  56. Command Line and Scripts
  57. How to Connect to AD DS Domains
  58. How to Connect to a Domain When 802.1X Authentication Is Not Enabled
  59. How to Connect to a Domain When 802.1X Authentication Is Enabled