DHCP relay agent: Giaddr vs source address


How a DHCP Relay Agent and DHCP Relay Server Work:

DHCP Relay Agent

DHCP Relay Server

1. DHCP Relay Agent Profile:
Start by configuring a DHCP relay agent profile. This defines the relay agent's behavior.


2. DHCP Relay Agent Configuration:
Now configure the relay agent itself.


Under the "Match" tab, you can define criteria for forwarding DHCP messages based on:


In the forwarding information section, configure the DHCP server details:

Case 1: When we are using vrrp in LAN and we have multiple VLANS, we will use Giaddr as the vrrp IP of the specific Vlan and source address would be the actual source address of the vlan.

For example, here in pcap we see unicast packets coming from VIP 10.122.32.2 to Forwarding address(DHCP server) 10.22.16.20


Relay-Profile-LAN5 {
giaddr 10.122.32.2;    ← This would be the VIP IP
upstream-servers-and-relays {
Server-for-LAN5 {
forwarding-address [ 10.22.16.20 10.22.16.21 ];
source-address 10.122.32.3; ← This is the actual address on the VLAN5
                            fwd-routing-instance IPC05672-LAN1-VRF;

Another example of different Giaddr and source address:

Different Ingress and Egress Interfaces: If the relay agent receives the DHCP Discover from the client on one interface (e.g., a VLAN interface connected to the client subnet) and forwards the relayed DHCP packet to the server using another interface (e.g., a routed or loopback interface), the giaddr will typically be set to the IP address of the client-facing interface (to indicate the client’s subnet), while the source address of the relayed packet will be the IP of the interface used to reach the DHCP server


Case 2: Using same Giaddr and Source Address

The gateway address (giaddr) and the source address in a DHCP relay agent profile will be the same when the relay agent uses the same interface IP address both to receive the DHCP request from the client and to forward the relayed packet to the DHCP server. This typically happens in these scenarios:


Single Interface Relay: If the relay agent receives the client’s DHCP broadcast on an interface and also uses that same interface’s IP address to send the relayed DHCP packet to the server, both the giaddr and the source IP address will be identica

Explicit Source Configuration: If the relay agent is explicitly configured to use a specific interface as the source for relayed packets (e.g., using a loopback or the same VLAN interface), that address will appear as both the giaddr and the source IP