Sunday, November 16, 2008

DHCP Relay Agents

DHCP Relay Agent Overview

The Dynamic Host Configuration Protocol (DHCP) is a service that runs at the application layer of the TCP/IP protocol stack to dynamically assign IP addresses to DHCP clients, and to allocate TCP/IP configuration information to DHCP clients. This includes subnet mask information, default gateway IP addresses, DNS IP addresses, and WINS IP addresses. The DHCP protocol is derived from the Bootstrap Protocol (BOOTP) protocol. The DHCP server is configured with a predetermined pool of IP addresses (scopes), from which it allocates IP addresses to DHCP clients. During the boot process, DHCP clients request IP addresses, and obtain leases for IP addresses from the DHCP server.

When the DHCP client boots up on the network, the DHCP lease process occurs between the DHCP server and DHCP client. During the DHCP lease process, the DHCP scopes configured for a DHCP server is used to provide DHCP clients with IP addresses.

The DHCP lease process consists of four messages sent between the DHCP server and the DHCP client:

* DHCPDISCOVER message: This message is sent by a client when it boots up on the network to request an IP address lease from a DHCP server. The message is sent as a broadcast packet over the network, requesting for a DHCP server to respond to it
* DHCPOFFER message: This message is a response to a DHCPDISCOVER message, and is sent by one or numerous DHCP servers.
* DHCPREQUEST message: The client sends the initial DHCP server which responded to its request a DHCP Request message. The message indicates that the client is requesting the particular IP address for lease.
* DHCPACK message: The DHCP Acknowledge message is sent by the DHCP server to the DHCP client and is the process whereby which the DHCP server assigns the IP address lease to the DHCP client.

Because the DHCPDISCOVER message is a broadcast message, and broadcasts only cross other segments when they are explicitly routed, you might have to configure a DHCP Relay Agent on the router interface so that all DHCPDISCOVER messages can be forwarded to your DHCP server. Alternatively, you can configure the router to forward DHCP messages and BOOTP message. In a routed network, you would need DHCP Relay Agents if you plan to implement only one DHCP server.

For DHCP to operate, all of client computers should be able to contact the DHCP server. DHCP relies on the network topology, and is in turn relied on by all TCP/IP based hosts within your networking environment. Therefore, if your network has multiple segments, you have to perform either of the following:

* Place a DHCP server on each segment
* Place a DHCP Relay Agent on each segment
* Configure your routers to forward broadcast messages.

The DHCP Relay Agent makes it possible for DHCP broadcast messages to be sent over routers that do not support forwarding of these types of messages. The DHCP Relay Agent is therefore the routing protocol that enables DHCP clients to obtain IP addresses from a DHCP server on a remote subnet, or which is not located on the local subnet. If you have no configured DHCP Relay Agent, your clients would only be able to obtain IP addresses from the DHCP server which is on the same subnet. To enable clients to obtain IP addresses from a DHCP server on a remote subnet, you have to configure the DHCP Relay Agent on the subnet that contains the remote clients, so that it can relay DHCP broadcast messages to your DHCP server.

The systems that can use the DHCP Relay Agent are:

* Windows NT Server
* Windows 2000 Server
* Windows Server 2003

In routed networks, you need to either enable your routers to forward DHCP broadcast messages or configure a DHCP Relay Agent for the following reasons:

* The router will drop DHCP broadcast messages if it is not configured to forward them, and no DHCP Relay Agent exists.
* The DHCP lease process would not be able to place. The initial message sent by the DHCP client is a broadcast message.

Configuring the DHCP Relay Agent

The process for configuring the DHCP Relay Agent is outlined below:

* Enable Routing and Remote Access Server (RRAS)
* Install the DHCP Relay Agent routing protocol
* Configure DHCP Relay Agent properties
* Configure/enable the DHCP Relay Agent on the router interface to forward DHCP broadcast messages.
* View statistical information on the operation of the DHCP Relay Agent

How to enable Routing and Remote Access Server (RRAS)

1. Click Start, All Programs, Administrative Tools and then click Routing and Remote Access to open the Routing And Remote Access console.
2. Right-click the node of your server, and then choose Configure And Enable Routing and Remote Access from the shortcut menu.
3. The Routing and Remote Access Server Setup Wizard launches.
4. Click Next on the initial page of the wizard.
5. On the Configuration page, select the Custom Configuration option. Click Next.
6. On the Custom Configuration page, enable the LAN Routing checkbox. Click Next.
7. Verify your configuration settings on the Summary page.
8. Click Finish.
9. Click Yes when prompted to start the RRAS service.

How to install the DHCP Relay Agent routing protocol

1. Open the Routing And Remote Access console
2. Expand the IP Routing node in the console tree.
3. Right-click the General node, and then select New Routing Protocol from the shortcut menu.
4. The New Routing Protocol dialog box opens.
5. Select DHCP Relay Agent.
6. Click OK.

How to configure DHCP Relay Agent properties

1. Click Start, All Programs, Administrative Tools and then click Routing and Remote Access to open the Routing And Remote Access console.
2. Expand the IP Routing node in the console tree.
3. Right-click the DHCP Relay Agent node, and then select Properties from the shortcut menu.
4. On the General tab, enter the IP address of the DHCP server in the Server Address text box, and click Add.
5. Repeat the above step for each DHCP server that you have to add.
6. Click OK.

How to enable the DHCP Relay Agent on a router interface

1. Click Start, All Programs, Administrative Tools and then click Routing and Remote Access to open the Routing And Remote Access console.
2. Expand the IP Routing node in the console tree.
3. Right-click the DHCP Relay Agent node and then select New Interface from the shortcut menu.
4. Select the interface that is on the same subnet as the DHCP clients.
5. Click OK.
6. In the DHCP Relay Properties dialog box, ensure that the Relay DHCP Packets checkbox is selected on the General tab.
7. You can change the Hop-Count Threshold and Boot Threshold values.
8. Click OK.

How to view statistical information on the operation of the DHCP Relay Agent

1. Click Start, All Programs, Administrative Tools and then click Routing and Remote Access to open the Routing And Remote Access console.
2. Select the DHCP Relay Agent node, and view the statistical information that is displayed in the details pane of the Routing And Remote Access console:
* Received requests
* Received replies
* Discarded requests
* Discarded replies

No comments: