DHCP Relay

DHCP is the acronym for Dynamic Host Configuration Protocol, which uses a relay system to communicate with the DHCP server. It functions as a proxy for the DHCP broadcast messages that need to be routed to remote sections in the subnet. The DHCP Relay is usually configured with the address of the DHCP server where the message should be relayed.

The Relay Agent

The Relay Agent is a program used to transmit DHCP messages between servers and clients situated on different subnets. It also enables the user to position the DHCP servers and clients on separate networks. Setting DHCP within a segment of network is simple. Every DHCP message is considered as an IP broadcast message. As a result, every computer included in the segment can actually listen and give its response to these broadcasts.

The Relay Agent at Work

When the DHCP messages are broadcast in one of the physical interfaces, the Relay Agent works to transmit these messages to other subnets included in the network.

When a request is made by a client, the Relay Agent forwards the request to the servers specified in the list. If the DHCP server makes a reply, this reply is also uni-cast in the network.

The Relay Agent includes information on the IP address and presents some policies to client requests, then forwards it to the server. It also takes out all pieces of information from the replies given by the server to the client.

The Relay Commands

The Relay Agent can be initiated by using the dhrelay command and typing the server name where the request is to be sent. The following options can be used to start it:

  • The command “I” will specify the interfaces in the network to be configured. If there is no particular interface indicated, all the network’s interfaces will be included. This will possibly eliminate the non-broadcast interface.
  • The command “p” will specify the port where the dhrelay will listen. The Relay Agent will transmit the request to the given servers on this port and will send responses to the clients using a bigger port.
  • Typing the command “d” will cause the Relay Agent to be always in the foreground, while the “q” command will disable the printing of the network’s configuration of dhrelay.