Dynamic Host Configuration Protocol (DHCP) relay allows the network to forward DHCP messages between DHCP Clients and DHCP Servers. The configuration used in this topic should work whether the fabric is deployed in CRB or ERB model.
The DHCP Server and Clients communicate with each other over the existing network without further configuration when the DHCP Client and Server are in the same VLAN. When a DHCP Client and Server are in different VLANs, DHCP traffic between the client and server is forwarded between the VLANs through the IRB interfaces on spine/leaf devices. You must configure the IRB interfaces on the spine-and-leaf devices to support DHCP Relay.
When DHCP Relay is used with EVPN-VXLAN, you cannot configure any binding/snooping features that require the relay to maintain state for the DHCP packets. For latest updates on DHCP features, see DHCP User Guide.
Use the forward-only option for the DHCP Relay configuration. The forward–only option ensures that DHCP packets are forwarded on the switch without creating DHCP Server Client bindings.
Location of the DHCP Server
The DHCP Server is connected to the service leaf on the fabric or in a different DC and reachable over Layer 3 network. On the device which is performing the relay, the DHCP Server is reachable in a directly connected VLAN or over a Type 5 tunnel, see Figure 1 and Figure 2.
Default Gateway Function
You can use one of the following two models to enable the default gateway function:
IRB Interface with a VGA with Anycast IP Address
In this model, for a given VXLAN network identifier(VNI), configure an IRB interface on each provideredge(PE) device with a unique IP address and an anycast IP address. The Layer 3 VXLAN gateway automatically generates a MAC address.
When you configure the DHCP Relay in this model, the source address of the DHCP Relay packets is the unique IP address of the IRB interface. The Relay agent IP address (giaddr) in the DHCP request message is same as the unique IP address of the IRB interface.
The DHCP Server uses the giaddr field to:
Identify the pool for the DHCP request. DHCP Server looks for a pool that matches the subnet for the IP address available in the giaddr field.
Identify the destination IP address of the DHCP reply message. DHCP Server sends the DHCP reply message to the IP address available in the giaddr field.
IRB Interface with Anycast IP Address
Many data center deployments use IRB Anycast model to enable default gateway function. In this model, for a given VNI, configure an IRB interface on each PE device with the same Anycast IP address.
When you enable DHCP Relay in the Anycast IRB model, the source address of the DHCP Relay packets is the Anycast IP address of the IRB interface. The Relay agent IP address (giaddr) in the DHCP request message is the Anycast IP address of the IRB interface. The DHCP Server will send the DHCP reply message with the destination IP address using the address from giaddr field in the DHCP request message. DHCP reply message might go back to a leaf that did not relay the DHCP Client request. This is because all PE devices with an IRB in that VNI have the same IP address.
To address this issue, consider the following when you use IRB interface with Anycast IP address:
Relay agent IP address (giaddr) must be unique for each leaf or unique for each VRF inside a leaf in the case of multi-tenancy.
When you use the loopback address as the Relay agent IP address (giaddr), the DHCP reply messages returns to the same leaf that initiated the DHCP relay.
DHCP Server uses the giaddr field for pool selection. If the giaddr field is used as the loopback address of the leaf, it does not reflect actual subnet from which the IP address should be allocated. In this case, the DHCP Server is unable to select a pool to assign an IP address. To address this, include the option-82 attribute link-selection (suboption 5) in the DHCP Relay request. The option 82 attribute includes the IP address of the IRB interface on which the client request was received. The DHCP Server can reuse the information to identify the pool for the DHCP request.
For more details on default gateway configuration, see Using a Default Layer 3 Gateway to Route Traffic in an EVPN-VXLAN Overlay Network
Read VXLAN Constraints on QFX Series and EX Series Switches be aware of the constraints when you configure Virtual Extensible LANs (VXLANs) on QFX Series and EX Series switches.