87
10 Module 10A: The Dynamic Host Configuration Protocol

1 10 Module 10A: The Dynamic Host Configuration Protocol

Embed Size (px)

Citation preview

Page 1: 1 10 Module 10A: The Dynamic Host Configuration Protocol

1

10

Module 10A: The Dynamic Host

Configuration Protocol

Page 2: 1 10 Module 10A: The Dynamic Host Configuration Protocol

2

10

Overview

Describe the function of DHCP.

Explain how a DHCP client obtains IP addresses from a DHCP server.

Install DHCP in an internetwork.

Configure a DHCP scope for multiple subnets.

Configure DHCP scope options for multiple subnets.

Enable a computer to be a DHCP client.

Use the IPCONFIG utility to view IP configurations, and to renew or release a lease.

Backup and restore the DHCP database.

Use the JETPACK utility to compact the DHCP database.

Page 3: 1 10 Module 10A: The Dynamic Host Configuration Protocol

3

10

Testing TCP/IP with Ping

StartStartStartStart

EndEndEndEnd

Ping 127.0.0.1(Loopback Address)

Ping 127.0.0.1(Loopback Address)

1111

Ping IP AddressOf Your Computer

Ping IP AddressOf Your Computer

2222

Ping IP Address ofDefault Gateway

Ping IP Address ofDefault Gateway

3333

Ping IP Address ofRemote Host

Ping IP Address ofRemote Host

4444

Page 4: 1 10 Module 10A: The Dynamic Host Configuration Protocol

4

10

DHCP DatabaseIP Address1IP Address2IP Address3

DHCP DatabaseIP Address1IP Address2IP Address3

What Is DHCP?

IP Address2 IP Address1

DHCPServer

DHCPClient

Non-DHCPClient

DHCPClient

Page 5: 1 10 Module 10A: The Dynamic Host Configuration Protocol

5

10

What Is DHCP?

The Dynamic Host Configuration Protocol (DHCP) centralizes and manages the allocation of TCP/IP configuration information by automatically assigning IP addresses to computers configured to use DHCP. Implementing DHCP eliminates some of the configuration problems associated with manually configuring TCP/IP.

Page 6: 1 10 Module 10A: The Dynamic Host Configuration Protocol

6

10

What Is DHCP?

Each time a DHCP client starts, it requests IP addressing information from a DHCP server, including:

IP address

Subnet mask

Optional values, such as a default gateway address, Domain Name Server (DNS) address, DNS Domain Name and NetBIOS Name Server address.

Page 7: 1 10 Module 10A: The Dynamic Host Configuration Protocol

7

10

What Is DHCP?

When a DHCP server receives a request, it selects IP addressing information from a pool of addresses defined in its database and offers it to the DHCP client. If the client accepts the offer, the IP addressing information is leased to the client for a specified period of time.

If there is no available IP addressing information in the pool to lease to a client, the client cannot initialize TCP/IP.

Page 8: 1 10 Module 10A: The Dynamic Host Configuration Protocol

8

10

What Is DHCP?

Note:

DHCP is defined in RFCs 1533, 1534, 1541 and 1542. DHCP is an extension of the BOOTP protocol (RFC 951) for automatically assigning IP address information to diskless clients. All DHCP communication is performed over UDP ports 67 (BOOTP client) and 68 (BOOTP server). Windows NT Server 3.51 supports DHCP, an extension of BOOTP, but it is not a BOOTP server for BOOTP clients.

Page 9: 1 10 Module 10A: The Dynamic Host Configuration Protocol

9

10

Why Use DHCP?

Manual Approach

Difficult to trace the source of a problem

Communication problems from mistyped information

Administrative overhead: computer relocation

Dynamic Approach (DHCP)

Client IP address is automatically leased from DHCP server

All required configuration information is supplied

Configuration problems are eliminated

Page 10: 1 10 Module 10A: The Dynamic Host Configuration Protocol

10

10

Why Use DHCP?

To understand why DHCP is beneficial in configuring TCP/IP on client computers, it is useful to contrast the manual method with the DHCP method

Page 11: 1 10 Module 10A: The Dynamic Host Configuration Protocol

11

10

Configuring TCP/IP Manually

Currently, installing TCP/IP on a client requires careful configuration of an IP address, subnet mask, and default gateway before the client can communicate with other clients and servers. The configuration information required is not information that the typical network user will have knowledge of.

If a user installing TCP/IP randomly picks an IP address instead of getting a valid IP address from the network administrator, it can lead to network problems which can be very difficult to trace to the source.

An error in typing one of the numbers for the IP address, subnet mask, or default gateway can also lead to problems. These problems can range from trouble communicating using TCP/IP if the default gateway or subnet mask is wrong, to network problems with a duplicate IP address.

There will also be configuration and administrative overhead involved on networks where clients may frequently move between subnets. The IP address and default gateway used when a client is attached to one subnet needs to be changed when it is attached to another subnet to be able to communicate with network resources. This requires a valid IP address and default gateway for the new subnet from the administrator. The user or an administrator will need to change these configuration values on the computer.

Page 12: 1 10 Module 10A: The Dynamic Host Configuration Protocol

12

10

Configuring TCP/IP Using DHCP

Using DHCP to automatically configure IP addressing information means that:

Users no longer need to acquire IP addressing information from an administrator to properly configure TCP/IP. When a DHCP client is started, it automatically receives, or leases, IP addressing information from a DHCP server.

The DHCP server supplies all of the necessary configuration information to all DHCP clients. As long as the DHCP server has the correct configuration information, no DHCP client will be configured incorrectly.

Additional TCP/IP configuration values, such as type of NetBIOS name resolution and address of a Domain Name Server (DNS) can be supplied to the client during the lease process.

The difficult to trace network problems that results from incorrectly configured clients and servers will be a thing of the past.

Page 13: 1 10 Module 10A: The Dynamic Host Configuration Protocol

13

10

Note:

A DHCP server can not also be a DHCP client. A DHCP server must be manually configured with an IP address.

Page 14: 1 10 Module 10A: The Dynamic Host Configuration Protocol

14

10

How DHCP Works

Page 15: 1 10 Module 10A: The Dynamic Host Configuration Protocol

15

10

How DHCP Works

The process that DHCP uses to automatically configure a client is as follows:

Page 16: 1 10 Module 10A: The Dynamic Host Configuration Protocol

16

10

How DHCP Works

The client initializes a limited version of TCP/IP. If the client does not have a specific IP address to request, the client broadcasts a DHCPDISCOVER message to find DHCP servers and obtain a valid IP address.

Page 17: 1 10 Module 10A: The Dynamic Host Configuration Protocol

17

10

How DHCP Works

All DHCP servers that have a valid IP address for the client send a DHCPOFFER message via broadcast. The client uses the IP address from the first response received as the IP address it will request, unless the client is requesting a specific IP address.

Page 18: 1 10 Module 10A: The Dynamic Host Configuration Protocol

18

10

How DHCP Works

Once the client has selected an IP address to use, it broadcasts a DHCPREQUEST message to the DHCP servers asking to lease that IP address. If the IP address requested is the result of a DHCPOFFER message, the Request message contains a server identifier for the server that sent the offer.

Page 19: 1 10 Module 10A: The Dynamic Host Configuration Protocol

19

10

How DHCP Works

This DHCP server will respond to the DHCPREQUEST broadcast, all other DHCP servers remove their IP address offers to the client. The DHCP server assigns the IP address (and any other configured options) to the client and sends a DHCPACK (acknowledgment) to the DHCP client.

Page 20: 1 10 Module 10A: The Dynamic Host Configuration Protocol

20

10

How DHCP Works

The client finishes initializing and binding the TCP/IP protocol. Once the DHCP process is complete, the client is able to use all TCP/IP services and utilities for normal network communications and connectivity to other IP hosts.

Page 21: 1 10 Module 10A: The Dynamic Host Configuration Protocol

21

10

How DHCP Works

Note:

If a computer has multiple network adapters, the DHCP process occurs separately over each adapter. A unique IP address will be assigned to each adapter in the computer.

Page 22: 1 10 Module 10A: The Dynamic Host Configuration Protocol

22

10

DHCP Messages and Client States

Page 23: 1 10 Module 10A: The Dynamic Host Configuration Protocol

23

10

DHCP Messages and Client States

The DHCP client can go through six different states in the DHCP process:

Initializing

Selecting

Requesting

Bound

Renewing

Rebinding

Page 24: 1 10 Module 10A: The Dynamic Host Configuration Protocol

24

10

DHCP Messages and Client States

In these states, DHCP uses seven messages to communicate between the DHCP client and server.

DHCPDISCOVER (Client to Server)

DHCPOFFER (Server to Client)

DHCPREQUEST (Client to Server)

DHCPACK (Server to Client)

DHCPNAK (Server to Client)

DHCPDECLINE (Server to Client)

DHCPRELEASE (Client to Server)

Page 25: 1 10 Module 10A: The Dynamic Host Configuration Protocol

25

10

The Initializing State

Page 26: 1 10 Module 10A: The Dynamic Host Configuration Protocol

26

10

The Initializing State

The DHCP client is in the Initializing state when it is trying to initialize the TCP/IP stack and it does not yet have an IP address to request from the DHCP servers. This state occurs the very first time the TCP/IP protocol stack is initialized on the DHCP client computer. It also occurs if the client is denied the IP address it is requesting or the IP address it previously had was released

Page 27: 1 10 Module 10A: The Dynamic Host Configuration Protocol

27

10

The Initializing State

When the DHCP client is in the Initializing state, its IP address is 0.0.0.0. It's first task is to determine an IP address that it can use. It does this by broadcasting a DHCPDISCOVER message over UDP port 67. The DHCPDISCOVER message contains the DHCP client's media access control (MAC) address and computer name.

Since the DHCP client does not yet have an IP address and does not know the IP address of any DHCP servers, the source IP address for the DHCPDISCOVER broadcast is 0.0.0.0 and the destination is 255.255.255.255.

Page 28: 1 10 Module 10A: The Dynamic Host Configuration Protocol

28

10

The Selecting State

Page 29: 1 10 Module 10A: The Dynamic Host Configuration Protocol

29

10

The Selecting State

All DHCP servers that receive the DHCPDISCOVER message and have a valid IP address for the DHCP client will respond with a DHCPOFFER message over UDP port 68. The DHCP servers send their DHCPOFFER messages via broadcast since the DHCP client does not yet have an IP address. This message contains the DHCP client's MAC address, an offered IP address, appropriate Subnet Mask, a server identifier (the IP address of the offering DHCP server), and length of the lease

Page 30: 1 10 Module 10A: The Dynamic Host Configuration Protocol

30

10

The Selecting State

When a DHCP server sends a DHCPOFFER message offering an IP address, the DHCP server reserves the IP address so that it will not be offered to another DHCP client.

The DHCP client selects the IP address of the first DHCPOFFER received.

Page 31: 1 10 Module 10A: The Dynamic Host Configuration Protocol

31

10

The Selecting State

When No DHCP Servers are Online The DHCP client waits one second for DHCPOFFERs. If

a DHCP client does not receive a DHCPOFFER message from a DHCP server on startup, it will retry four times (at 2, 4, 8, and 16 second intervals, plus a random amount between 0 and 1000 milliseconds). If a DHCP client does not receive a DHCPOFFER after its four attempts, it will go to 'sleep' and retry again every five minutes.

Page 32: 1 10 Module 10A: The Dynamic Host Configuration Protocol

32

10

The Requesting State

Page 33: 1 10 Module 10A: The Dynamic Host Configuration Protocol

33

10

The Requesting State

In this state the DHCP client knows the IP address it wants to lease so it broadcasts a DHCPREQUEST message to all of the DHCP servers. The client must use a broadcast since it does not yet have an IP address. The data in the DHCPREQUEST message varies depending on how the requested IP address was obtained.

Page 34: 1 10 Module 10A: The Dynamic Host Configuration Protocol

34

10

The Requesting State

If the IP address of the client was previously known, i.e. the computer was rebooted and is trying to lease its previous address, then the broadcast is looked at by all of the DHCP servers. The DHCP server that can lease the requested IP address responds with either a successful acknowledgment (DHCPACK) or an unsuccessful acknowledgment (DHCPNAK). The DHCPNAK message occurs when the IP address requested is not available or the client has been physically moved to a different subnet which would require a different IP address. After receiving this message the client returns to the Initializing state.

Page 35: 1 10 Module 10A: The Dynamic Host Configuration Protocol

35

10

The Requesting State

If the IP address of the client was just obtained with a DHCPDISCOVER/DHCPOFFER exchange, the client will include the IP address of the server it received the offer from in the DHCPREQUEST message. This server identifier causes the specified DHCP server to respond to the request and all other DHCP servers to retract their DHCP offers to the client. This makes the offered IP addresses on the other DHCP servers immediately available to the next initializing DHCP client.

Page 36: 1 10 Module 10A: The Dynamic Host Configuration Protocol

36

10

The Bound State

Page 37: 1 10 Module 10A: The Dynamic Host Configuration Protocol

37

10

The Bound State

The DHCP server responds to the DHCPREQUEST message with a DHCPACK (DHCP acknowledgment) message that contains a valid lease for the negotiated IP address as well as any optional parameters configured by the DHCP administrator. Once again, the DHCPACK message is sent by the DHCP server via broadcast. When the DHCP client receives the DHCPACK message, it completes initialization of TCP/IP and is now considered a bound DHCP client and can use TCP/IP to communicate on the network.

Page 38: 1 10 Module 10A: The Dynamic Host Configuration Protocol

38

10

The Bound State

Note:

The DHCPDISCOVER/DHCPOFFER/DHCPREQUEST/ DHCPACK messages are sent out via MAC-level broadcasts. For DHCP clients to communicate with a DHCP server on a remote network, the connecting router(s) must support forwarding DHCP broadcasts. Not all routers support RFC 1542 (DHCP) and have this capability and may require a software upgrade for this support.

Page 39: 1 10 Module 10A: The Dynamic Host Configuration Protocol

39

10

The client stores the IP address, subnet mask, and other IP addressing information locally in one of the following locations:

On Windows NT and Windows 95 computers - HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Services\adapter\Parameters\Tcpip

On Windows for Workgroups computers - \windir\DHCP.BIN (encrypted)

Page 40: 1 10 Module 10A: The Dynamic Host Configuration Protocol

40

10

IP Lease Acknowledgment (Unsuccessful)

An unsuccessful acknowledgment is broadcast (DHCPNACK) if:

The client is trying to lease its previous IP address and the IP address is no longer available, or

The IP address is invalid because the client has been physically moved to a different subnet.

When the client receives an unsuccessful acknowledgment, it returns to the process of requesting an IP lease.

Page 41: 1 10 Module 10A: The Dynamic Host Configuration Protocol

41

10

Note:

Whenever a DHCP server receives a request for an IP address which is invalid according to the scopes that it is configured with, it sends a DHCPNACK negative acknowledgment to the client. With every negative acknowledgment the DHCP server also records an event in the Windows NT event log.

Page 42: 1 10 Module 10A: The Dynamic Host Configuration Protocol

42

10

The Renewing State

Page 43: 1 10 Module 10A: The Dynamic Host Configuration Protocol

43

10

The Renewing State

By default, DHCP clients first try to renew their lease when 50% of the lease time has expired. To renew its lease, a DHCP client sends a directed DHCPREQUEST message to the DHCP server from which it obtained the lease.

Page 44: 1 10 Module 10A: The Dynamic Host Configuration Protocol

44

10

The Renewing State

If permitted, the DHCP server will automatically renew the lease by responding with a DHCPACK message. This DHCPACK message will contain the new lease as well as any configuration parameters so that the DHCP client can update its settings in case the administrator updated any settings on the DHCP server. Once the DHCP client has renewed its lease, it returns to the Bound state.

Page 45: 1 10 Module 10A: The Dynamic Host Configuration Protocol

45

10

The Renewing State

If a DHCP client attempts to renew its lease on an IP address and is unable to contact a DHCP server, the use is prompted with an error message.

Page 46: 1 10 Module 10A: The Dynamic Host Configuration Protocol

46

10

The Rebinding State

Page 47: 1 10 Module 10A: The Dynamic Host Configuration Protocol

47

10

The Rebinding State

If, for some reason, the DHCP client is unable to communicate with the DHCP server from which it obtained its lease, when 87.5% of the lease time has expired it will attempt to contact ANY available DHCP server. The DHCP client attempts to contact any DHCP server by broadcasting DHCPREQUEST messages so that any DHCP server can provide a new IP address lease to the client. Any DHCP server can respond with a DHCPACK message renewing the lease or a DHCPNACK message that will force the DHCP client to re-initialize and obtain an IP address lease for a new IP address.

Page 48: 1 10 Module 10A: The Dynamic Host Configuration Protocol

48

10

The Rebinding State

If the lease expires or a DHCPNACK message is received, the DHCP client must immediately discontinue using the IP address. However, the DHCP client will return to the Initializing state and attempt to obtain another IP address lease.

If the client loses its IP address, communication over TCP/IP will stop until a new IP address is assigned to the client. This will cause network errors for any applications that attempt to communicate over the TCP/IP protocol interface that has become invalid.

Page 49: 1 10 Module 10A: The Dynamic Host Configuration Protocol

49

10

DHCP Across IP Routers

Page 50: 1 10 Module 10A: The Dynamic Host Configuration Protocol

50

10

DHCP Across IP Routers

The preceding explanation of how DHCP works assumed that the DHCP client and DHCP server were on the same network. In a large IP internetwork, it is desirable to place DHCP servers in strategic locations servicing clients of multiple networks. In order for this to occur, the DCHP messages (DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK/ DHCPNAK) must be able to cross IP routers. Without the ability to have these DHCP messages to cross IP routers, a DHCP server would be required on each subnet for which there are DHCP clients.

Page 51: 1 10 Module 10A: The Dynamic Host Configuration Protocol

51

10

DHCP Across IP Routers

The four broadcast-based DCHP messages (DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK/DHCPNAK) are sent to the limited IP broadcast address 255.255.255.255 and as MAC level broadcasts. By default, IP routers will not pass any broadcast frames but the DHCP messages are an exception.

Page 52: 1 10 Module 10A: The Dynamic Host Configuration Protocol

52

10

DHCP Across IP Routers

Historically, DHCP is based on the BOOTP protocol, a protocol for supplying IP address information to diskless workstations upon system startup. In order to have the BOOTP messages cross an IP router, a special component was implemented on the IP router called a BOOTP relay agent. The BOOTP relay agent recognizes the BOOTP packets because they are addressed to the MAC-layer broadcast address, the IP limited broadcast address and using either UDP port 68 or 67 and then passes these packets to the other networks to which it is connected. The BOOTP relay agent allowed the BOOTP servers to be on different networks than the BOOTP client.

Page 53: 1 10 Module 10A: The Dynamic Host Configuration Protocol

53

10

DHCP Across IP Routers

DHCP is an extension of BOOTP. RFC 1542 documents the extensions to the BOOTP protocol to support DHCP and also specifies the changes to the BOOTP Relay Agent that are required to support DHCP messages. In order for a BOOTP Relay Agent to support DHCP messages, it must be compliant with RFC 1542. Not all routers support RFC 1542 directly, and may require a software upgrade.

Page 54: 1 10 Module 10A: The Dynamic Host Configuration Protocol

54

10

Recording the originating network

For the DHCP server to allocate an IP address that is proper for the network where the client is located, it must have some knowledge of the DHCP client's IP network ID. Since the client cannot provide this information in its initial DHCPDISCOVER message, the information must come from somewhere else.

Page 55: 1 10 Module 10A: The Dynamic Host Configuration Protocol

55

10

Recording the originating network

In the DHCP message packet structure is a field called "giaddress". The purpose of this field is to record the IP address of the router interface first encountered by the DHCPDISCOVER and DHCPREQUEST message. The RFC 1542 compliant BOOTP relay agent on the IP router sees the DHCP message and inspects the giaddress field. If it is empty, it places the IP address of the interface which received the DHCP message into the giaddress field.

Page 56: 1 10 Module 10A: The Dynamic Host Configuration Protocol

56

10

Recording the originating network

In the above example, when DCHP Client 1 broadcasts the DHCPDISCOVER message, the router will record the IP address 131.107.1.1 in the giaddress field of the DHCP message. Once received, the DHCP server determines that DHCP Client 1 is located on network 131.107.1.0 and sends a DHCPOFFER message from the scope of addresses for network 131.107.1.0.

Page 57: 1 10 Module 10A: The Dynamic Host Configuration Protocol

57

10

Implementation Considerations

Before you install DHCP, ask yourself these questions:

Page 58: 1 10 Module 10A: The Dynamic Host Configuration Protocol

58

10

What IP addressing options will clients obtain from a DHCP server?

Such as:

Default gateway

WINS server

DNS server

DNS Domain Name (Windows NT 3.51 and above)

The IP addressing options determine how to configure the DHCP server, and whether the options should be created for all clients in the internetwork, clients on a specific subnet, or individual clients.

Page 59: 1 10 Module 10A: The Dynamic Host Configuration Protocol

59

10

Will all computers become DHCP clients?

If not, consider that:

Non-DHCP clients have static IP addresses.

Static IP addresses must be excluded from the DHCP server configuration.

If a client requires a specific address, the IP address needs to be reserved.

Page 60: 1 10 Module 10A: The Dynamic Host Configuration Protocol

60

10

Will a DHCP server supply IP addresses to multiple subnets?

If so, consider that:

Any routers connecting subnets must support RFC 1542 and act as BOOTP Relay Agents. If your routers do not support RFC 1542, at least one DHCP server is required on each subnet that has DHCP clients.

Page 61: 1 10 Module 10A: The Dynamic Host Configuration Protocol

61

10

How many DHCP servers are required?

Consider that:

A DHCP server does not share information with other DHCP servers. Therefore, it is necessary to create unique IP addresses for each server to assign to clients.

Page 62: 1 10 Module 10A: The Dynamic Host Configuration Protocol

62

10

Considerations for Implementing Multiple DHCP Servers

Page 63: 1 10 Module 10A: The Dynamic Host Configuration Protocol

63

10

Considerations for Implementing Multiple DHCP Servers

If your internetwork requires multiple DHCP servers, it is necessary to create a unique scope for each subnet. A scope is a range of IP addresses that are available to be leased or assigned to clients.

Page 64: 1 10 Module 10A: The Dynamic Host Configuration Protocol

64

10

Considerations for Implementing Multiple DHCP Servers

To ensure that clients can lease IP addresses, it is important to have multiple scopes for each subnet distributed among the DHCP servers in the internetwork. For example:

Each DHCP server should have a scope containing approximately 75 percent of the available IP addresses for the local subnet.

Each DHCP server should have a scope for each remote subnet containing approximately 25 percent of the available IP addresses for a subnet.

Page 65: 1 10 Module 10A: The Dynamic Host Configuration Protocol

65

10

Considerations for Implementing Multiple DHCP Servers

When a client's DHCP server is unavailable, the client can still receive an address lease from another DHCP server on a different subnet.

As illustrated in the graphic, Server-A has a scope for the local subnet with an IP address range of 131.107.4.20 through 131.107.4.150, and Server-B has a scope with an IP address range of 131.107.3.20 through 131.107.3.150. Each server can lease IP addresses to clients on its own subnet.

Additionally, each server has a scope containing a small range of IP addresses for the remote subnet. For example, Server-A has a scope for Subnet-B with the IP address range of 131.107.3.151 through 131.107.3.200. Server-B has a scope for Subnet-A with the IP address range of 131.107.4.151 through 131.107.4.200.

Page 66: 1 10 Module 10A: The Dynamic Host Configuration Protocol

66

10

Considerations for Implementing Multiple DHCP Servers

When a client on Subnet-A is unable to lease an address from Server-A, it can lease an address for its subnet from Server-B.

Note:

When implementing multiple DHCP servers and distributing the address pool for fault tolerance, it is possible to have overlapping scopes. DHCP servers have no awareness of each other and do not communicate with each other to ensure that they have a unique pool of addresses for each network. With two DHCP servers and an overlapping scope, it is possible for the same IP address to be allocated to two different nodes.

Page 67: 1 10 Module 10A: The Dynamic Host Configuration Protocol

67

10

DHCP Requirements

To implement DHCP, both the client and the server require configuration.

Page 68: 1 10 Module 10A: The Dynamic Host Configuration Protocol

68

10

DHCP Requirements: Router Requirement

All routers connecting subnets with DHCP servers and clients must support RFC 1542 and act as BOOTP Relay Agents.

Page 69: 1 10 Module 10A: The Dynamic Host Configuration Protocol

69

10

DHCP Requirements: Server Requirements

A DHCP server requires:

The DHCP Server service configured on at least one computer within the TCP/IP internetwork running Windows NT Server (it does not have to be a domain controller), provided that your IP routers support RFC 1542. Otherwise, you will need a DHCP server on each subnet.

The DHCP server configured with a static IP address, subnet mask, default gateway, and other TCP/IP parameters (it cannot be a DHCP client).

A DHCP scope created on the DHCP server. A DHCP scope consists of a range, or pool, of IP addresses that the DHCP server can assign, or lease, to DHCP clients- for example, 131.107.3.51 through 131.107.3.200.

Page 70: 1 10 Module 10A: The Dynamic Host Configuration Protocol

70

10

DHCP Requirements: Client Requirements

A DHCP client requires: A computer running any of the following supported operating

systems: Windows NT Server 3.5 and above (cannot be a DHCP server).Windows NT Wrkstation 3.5 and above. Windows 95. Windows for Workgroups 3.11 running Microsoft® TCP/IP-32 (provided on the Windows NT Server 3.5 and above CD).Microsoft Network Client 3.0 for MS-DOS with the real mode TCP/IP driver included on the Windows NT Server 3.5 and above CD. LAN Manager 2.2c included on the Windows NT Server 3.5 and above CD. LAN Manager 2.2c for OS/2 is not supported.

Third party DHCP client.

DHCP enabled.

Page 71: 1 10 Module 10A: The Dynamic Host Configuration Protocol

71

10

DHCP Client Platforms

IPRouter

DHCP Server

Windows NTWorkstation/ServerWindows 2000Windows XPWindows 2003

MicrosoftNetwork Client orLAN Manager 2.2c

Windows forWorkgroups 3.11

Windows 95/98/MeWorkstation

Page 72: 1 10 Module 10A: The Dynamic Host Configuration Protocol

72

10

The IPCONFIG Utility

The IPCONFIG utility is a diagnostic tool used to verify a computer's TCP/IP configuration

Page 73: 1 10 Module 10A: The Dynamic Host Configuration Protocol

73

10

Verifying the IP Configuration

From a command prompt, type the following command to verify a computer's IP address, subnet mask, and default gateway:

ipconfig

From a command prompt, type the following command to verify a computer's IP configuration for the operating system and the network adapter:

ipconfig /all

Page 74: 1 10 Module 10A: The Dynamic Host Configuration Protocol

74

10

Use the /ALL switch and provide the following information:

Host name assigned to the local computer.

IP address of any DNS Servers the local computer is configured to use.

NetBIOS node type, such as broadcast, hybrid, peer-peer, and mixed.

NetBIOS scope ID.

Whether or not IP Routing is enabled.

Whether or not WINS proxy is enabled.

Whether or not NetBIOS resolution uses DNS.

Page 75: 1 10 Module 10A: The Dynamic Host Configuration Protocol

75

10

Use the /ALL switch and provide the following network adapter IP configuration information:

Description of the adapter card, such as Etherlink II.

Physical address of the adapter card.

Whether or not DHCP is enabled.

IP address of the local computer.

Subnet mask of the local computer.

Default gateway of the local computer.

IP addresses of the primary and secondary WINS servers.

Page 76: 1 10 Module 10A: The Dynamic Host Configuration Protocol

76

10

Updating a Lease

The /RENEW switch causes a DHCPREQUEST message to be sent to the DHCP server to get updated options and lease time. If the DHCP server is unavailable, the client will continue using the current DHCP supplied configuration options. From a command prompt type:

ipconfig /renew

Page 77: 1 10 Module 10A: The Dynamic Host Configuration Protocol

77

10

Releasing a Lease

The /RELEASE switch causes the DHCP client to send a DHCPRELEASE message to the DHCP Server and give up its lease. This is useful when the client is changing to a different network and will not need the previous lease. After this command has been carried out, TCP/IP communications will stop. From a command prompt, type:

ipconfig /release

Microsoft DHCP clients do not initiate DHCPRELEASE messages when shutting down. If a client remains shut down for the length of its lease (and the lease is not renewed), it is possible for the DHCP server to assign that client's IP address to a different client after the lease expires. By not sending a DHCPRELEASE message, the client has a better chance of receiving the same IP address during initialization

Page 78: 1 10 Module 10A: The Dynamic Host Configuration Protocol

78

10

Backing Up and Restoring the DHCP Database

Backing Up the DHCP Database

Restoring the DHCP Database

Page 79: 1 10 Module 10A: The Dynamic Host Configuration Protocol

79

10

Backing Up the DHCP Database

By default, the DHCP database is backed up every 60 minutes. Backup copies are stored in the \systemroot\SYSTEM32\DHCP\BACKUP\JET directory.

The default backup interval can be changed by setting the BackupInterval value to the appropriate number of minutes. This BackupInterval parameter is located in Registry under the following key:

HKEY_LOCAL_MACHINE \SYSTEM

\CurrentControlSet \Services \DHCPServer \Parameters \BackupInterval

A copy of this Registry subkey is stored in the \systemroot\SYSTEM32\DHCP\BACKUP directory as DHCPCFG.

Page 80: 1 10 Module 10A: The Dynamic Host Configuration Protocol

80

10

Restoring the DHCP Database

The DHCP database can be restored either automatically or manually. The restore process is done using any of the following methods.

Restart the DHCP Server service. If the DHCP Server service detects a corrupt database, it automatically restores a backup copy of the database.

Set the RestoreFlag value to 1, and then restart the DHCP Server service. The RestoreFlag parameter is located in the Registry under the following key:

HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \DHCPServer \Parameters

Once the database has been successfully restored, the server automatically changes the value back to the default value of 0.

Copy the contents of the \systemroot\SYSTEM32\DHCP\BACKUP\JET directory to the \systemroot\SYSTEM32\DHCP directory, and then restart the DHCP Server service.

Page 81: 1 10 Module 10A: The Dynamic Host Configuration Protocol

81

10

Note:

Using the restore procedure, the DHCP server can also be moved to another Windows NT server computer. Note if the files are put into a different directory or on a new partition, you will need to edit the ....\Services\DHCPServer \parameters\DatabasePath and BackupDatabasePath to reflect the new location.

Page 82: 1 10 Module 10A: The Dynamic Host Configuration Protocol

82

10

Reconciling the DHCP Database

With Windows NT 3.51 and later there is a new Reconcile button in the active leases dialog which will verify that all entries in the registry (every lease is stored in the registry as well as the dhcp.mdb file) is correct. More information can be found in the TCP/IP Supplement document included in Windows NT 3.51.

Page 83: 1 10 Module 10A: The Dynamic Host Configuration Protocol

83

10

The DHCP Database Files

The following files are stored in the \systemroot\SYSTEM32\DHCP directory:

Caution: Do not tamper with or remove these files.

File Description

DHCP.MDB The DHCP database file.

DHCP.TMP A temporary file that DHCP creates for temporary database information while the DHCP Server service is running.

JET.LOG and JET*.LOG Logs of all transactions done with the database and are used by DHCP to recover data if necessary.

SYSTEM.MDB Used by DHCP for storing information about the structure of the database.

Page 84: 1 10 Module 10A: The Dynamic Host Configuration Protocol

84

10

Compacting the DHCP Database

The size of the DHCP database depends on the number of DHCP clients, the frequency that clients are moved from one subnet to another, and the frequency that clients renew a lease.

The JETPACK (JETPACK.EXE) utility is used to compact the DHCP database. It is recommended to compact the database whenever its size grows beyond 10 MB.

Page 85: 1 10 Module 10A: The Dynamic Host Configuration Protocol

85

10

To compact the database:

1. Stop the DHCP Server service. This can be done from Control Panel Services, Server Manager, or a command prompt. To stop the service from a command prompt, use the following command syntax:

net stop dhcpserver

2. From the \systemroot\SYSTEM32\DHCP directory, run the JETPACK utility using the following command syntax (assign any filename to temporary_name):

jetpack dhcp.mdb temporary_name.mdb The contents of DHCP.MDB are compacted in temporary_name, and then the temporary file is copied to DHCP.MDB, and the temporary name is deleted.

3. Restart the DHCP Service from Control Panel Services, Server Manager, or a command prompt. To restart the service from a command prompt, use the following command syntax:

net start dhcpserver

Page 86: 1 10 Module 10A: The Dynamic Host Configuration Protocol

86

10

Review

TCP/IP Overview

TCP/IP for Heterogeneous Networking

Microsoft TCP/IP on Windows NT Server

TCP/IP Configuration Parameters

Installing Microsoft TCP/IP

Testing TCP/IP with Ping

What Is DHCP?

What Is WINS?

Page 87: 1 10 Module 10A: The Dynamic Host Configuration Protocol

87

10

Lab 10: Implementing DHCP