DHCP Relay Agent

DHCP is a network management protocol that is used to automatically assign IP addresses to devices on a local network. This is done through broadcasting DHCP messages so the DHCP server can respond. But what if the DHCP server is located on another subnet? This is where a DHCP relay agent takes over.

Relay Agent– A DHCP relay agent is a router or a layer 3 device that is responsible for listening to DHCP broadcast messages from clients and forwarding them to the DHCP server on a different subnet. This allows an organization to centrally manage the IP address and other network configurations from a central location. The router in the subnet can be configured as a relay agent with the IP address of the DHCP server (“ip helper-address 192.168.1.11.) Once that is done, any DHCP broadcast message sent to the network will be intercepted by the router, and that router will turn that broadcast packet into a unicast packet. The source IP address will be the router’s outgoing interface and the destination IP will be the DHCP server. 

Giaddr- On top of the unicast message, the router also includes a specific field in the packet called “giaddr” which means the gateway IP address. This field is used to indicate the IP address of the interface that was responsible for forwarding the DHCP message to the server. This interface is the interface that is facing the clients in the subnet. This giaddr field is vital because it allows the DHCP server to know which subnet the client belongs to, allowing the server to choose the correct IP address pool when offering an IP address lease. Once the server responds and sends the offer back to the DHCP relay agent, the relay agent then “relays” that DHCP message back to the client. 

Leave a Reply

Your email address will not be published. Required fields are marked *