Cisco IOS DHCP Relay Agent

Hello Rohit

The DHCP relay agent uses the GIADDR (Gateway IP Address) field in the DHCP packet to know where to send the DHCP offer back to. When a DHCP relay agent receives a DHCP discover message from a client, it inserts its own IP address (the IP address of the interface that received the DHCP discover message) into the GIADDR field and then forwards the message to the DHCP server.

When the DHCP server receives this message, it uses the GIADDR to determine the subnet from which the request came and the IP address that it should offer. The server then sends a DHCP offer back to the relay agent, again using the GIADDR field to determine where to send it.

The relay agent then broadcasts the offer on the local network, and the client that originally sent the discover message receives it. The client’s MAC address is included in the Client Identifier field of the DHCP packet, so the client knows that the offer is for it, and other hosts know that the offer is not for them.

So, the GIADDR is used so that the DHCP server knows the subnet from which the original request was made (so it knows what IP address to offer, and to what subnet to send the offer). Once the offer gets to the relay agent, it can use the MAC address of the originating host which is found in the Client Identifier Field of the DHCP OFFER message so that the correct host will receive it and process it.

I hope this has been helpful!

Laz