DHCP Relay Agent

The DHCP (Dynamic Host Configuration Protocol) Relay Agent is used to connect DHCP servers and DHCP clients which are on different networks.

It allows DHCP broadcast messages to be transmitted over routers that do not support the transfer of these types of messages. Therefore, the DHCP Relay Agent is the routing protocol that allows the DHCP server, which is on a remote subnet or not located on the local subnet, to send IP addresses to a DHCP client.

A DHCP Relay Agent can be used by the following systems:

  • Windows Server 2003
  • Windows 2000 Server
  • Windows NT Server

What Is A Dynamic Host Configuration Protocol?

Dynamic Host Configuration Protocol (DHCP) is a network service used by networked devices or clients. It runs at the application layer of the TCP/IP protocol stack.

It is used to provide computer systems with an automatic allocation for IP addresses, as well as other IP parameters necessary for operation in an Internet Protocol network.

This includes default gateway IP addresses, WINS IP addresses, DNS IP addresses, and subnet mask information.

DHCP reduces the workload in the system administration by allowing devices to be added to the network with little or no manual configurations.

This protocol employs client-server architecture, which means that the software needed to transfer the service is configured in two parts:

  • A client requesting the service
  • A server providing the service

DHCP Lease Process

The DHCP server is put together with a predetermined list of IP addresses or scopes. When the DHCP client starts up on the network, the DHCP lease process between the DHCP server and client begins. During this process, the DHCP server allocates IP addresses to DHCP clients.

This process consists of four messages sent between the DHCP client and the DHCP server. They are as follows:

  • DHCPDISCOVER message. This message is transmitted by a client to request for an IP address lease from a DHCP server. It is sent as a broadcast packet, requesting for a DHCP server to respond to it.
  • DHCPOFFER message. It is the answer to a DHCPDISCOVER message. This message is sent by one or several DHCP servers.
  • DHCPREQUEST message. This message specifies that the client is requesting the particular IP address for lease.
  • DHCPACK message. It is an acknowledgement message wherein the DHCP server assigns the IP address lease to the DHCP client.

Configuring DHCP Relay Agent

DHCPDISCOVER message is a broadcast message which can only be transmitted to other segments when they are explicitly routed. Therefore, the DHCP Relay Agent must be configured on the router interface. This will enable all DHCPDISCOVER messages to be forwarded to the DHCP server.

Configuring DHCP Relay Agents will enable DHCP clients to obtain IP addresses from a DHCP server on a remote subnet. As a result, DHCP broadcast messages can be relayed by the DHCP server.

In cases where it hasn’t been configured, DHCP clients can only obtain IP addresses from the DHCP server on the same subnet.

The process for configuring the DHCP Relay Agent is as follows:

  1. Enabling Routing and Remote Access Server (RRAS)
    • Click the Start menu
    • Click All Programs
    • Click Administrative Tools
    • Click Routing and Remote Access to open the Routing And Remote Access console
    • Right-click the node of the server
    • Choose the Configure And Enable Routing and Remote Access from the shortcut menu to launch the Routing and Remote Access Server Setup Wizard
    • Click Next on the initial page of the wizard
    • Select the Custom Configuration option on the Configuration page then click Next
    • Enable the LAN Routing checkbox on the Custom Configuration page then click Next
    • Verify configuration settings on the Summary page
    • Click Finish
    • Click Yes when asked to start the RRAS service

  2. Installing the DHCP (Dynamic Host Configuration Protocol) Relay Agent routing protocol
    • Open the Routing And Remote Access console
    • Expand the IP Routing node in the console tree.
    • Right-click the General node.
    • Select New Routing Protocol from the shortcut menu to open the New Routing Protocol dialog box
    • Select DHCP Relay Agent
    • Click OK

  3. Configuring the properties of DHCP Relay Agent
    • Click the Start menu
    • Click All Programs
    • Click Administrative Tools
    • Click Routing and Remote Access to open the Routing And Remote Access console
    • Expand the IP Routing node in the console tree.
    • Right-click the DHCP Relay Agent button.
    • Select Properties from the shortcut menu,
    • Type the IP address of the DHCP server in the Server Address text box located on the General tab
    • Click Add
    • Repeat the above step for each DHCP server that you have to add
    • Click OK

  4. Configuring DHCP (Dynamic Host Configuration Protocol) Relay Agent on the router interface to forward DHCP broadcast messages
    • Click the Start menu
    • Click All Programs
    • Click Administrative Tools
    • Click Routing and Remote Access to open the Routing And Remote Access console
    • Expand the IP Routing node
    • The DHCP Relay Agent button is then right-clicked
    • Select New Interface from the shortcut menu.
    • Select the interface that is on the same subnet as the DHCP clients
    • Click OK
    • On the General tab, select the Relay DHCP Packets checkbox
    • Change the Boot Threshold values and Hop-Count Threshold
    • Click OK

  5. Viewing statistical information on the operation of the DHCP Relay Agent
    • Click the Start menu
    • Click All Programs
    • Click Administrative Tools
    • Click Routing and Remote Access to open the Routing And Remote Access console
    • Select the DHCP Relay Agent button
    • View the statistical information that is presented in the details pane of the Routing And Remote Access console
    • i. Received requests

      ii. Received replies
      iii. Discarded requests
      iv. Discarded replies