Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure a DHCP Relay in EVPN-VXLAN Fabric Architecture

DHCP Relay is an essential feature in most data center deployments. This example shows how to configure DHCP Relay in an EVPN-VXLAN-based data center fabric. The document also covers other common deployment models for DHCP Relay depending on how the DHCP Server is connected to the network. See Technical Overview for details.

Requirements

This example uses the following hardware and software components:

  • QFX5120 switches or QFX10002 switches

  • Junos OS Release 18.4R2-S5

We’ve tested the configuration example using Junos OS Release 18.4R2-S5.

For details on supported platforms and Junos or Junos Evolved release support for DHCP relay, see Feature Explorer.

Overview

The DHCP Relay agent operates as the interface between DHCP Clients and the Server. DHCP Relay agent forwards incoming requests from DHCP Clients to a specified DHCP Server. In this example, we are using the Edge-routed bridging (ERB) topology as shown in Figure 1.

Figure 1: DHCP Relay OverviewDHCP Relay Overview

In the case of ERB, the inter-VLAN routing happens at the server leaf layer. The server leaf switches are configured to perform DHCP Relay function for the VLANs that have IRB interfaces configured on those switches.

You can apply the similar DHCP Relay configuration to a centrally-routed bridging (CRB) topology as well. In the case of CRB, Inter-VLAN routing happens at the spine switches level. So, the DHCP Relay must be configured on the spine switches.

Configuration

DHCP Relay Configuration with Virtual Gateway Address (VGA)

Step-by-Step Procedure

Do the steps that follow to configure DHCP relay for the IRB interface configured with VGA.

  1. Enable DHCP Relay with forward-only option. The forward–only option ensures that DHCP packets are forwarded on the switch and that no DHCP Server Client bindings are created.

    Do not use any other DHCP Relay overrides.

  2. Create and activate the DHCP Relay server group.

    The DHCP Relay server group include one or more DHCP Servers—individually identified by IP address—and a user-defined name for the servers. In this example, one DHCP server—10.101.10.31—is assigned into a DHCP server group named Server_Group1.

  3. Associate the server group with the IRB interfaces on the leaf devices.

DHCP Relay Configuration with Anycast IRB

Step-by-Step Procedure

Do the steps below to configure DHCP Relay for IRB interface configured with Anycast IP address.

  1. Configure the DHCP Relay with the loopback address that will be used as relay source.

  2. Enable DHCP Relay option 82 with server-id-override option.

  3. Create the DHCP Relay server group and associate the server group with the IRB interfaces on the leaf devices. Same as in procedure DHCP Relay Configuration with Virtual Gateway Address (VGA).

  4. Check packet capture on the DHCP Server to verify the contents of the relayed DHCP packet. Figure 2 shows the sample packet capture file.

    Figure 2: Packet Capture on the DHCP ServerPacket Capture on the DHCP Server

    In the sample, you can notice that the relay agent IP address is the loopback IP address and the link selection attribute shows the IP address of the IRB interface.

DHCP Server Reachable only in a Service VRF

Step-by-Step Procedure

Do the steps below to configure the DHCP Server in a Service VRF.

  1. Configure the loopback interfaces.

    Apart from the lo0.0 interface used for VTEP, you must use a separate loopback interfaces for every routing instance. In this case, the loopback interface lo0.110 is associated with the DHCP Server VRF. The loopback interface lo0.120 is associated with the DHCP Client VRF.

  2. Configure the routing instance where the DHCP Server is located. The DHCP Server is located in VLAN 99 with IRB.99. The IRB.99 is placed in TENANT_SERVICE_VRF.

    Complete the following configurations in the Service VRF:

    • Configure the dhcp-relay forward-only-replies option to enable DHCP response packets forwarded to the DHCP Clients in the other VRF.

    • Configure the auto-export command along with vrf-target export and import policies that also import routes from the DHCP Client VRFs.

  3. Configure the routing instances where the DHCP Clients are located.

    In this case, the DHCP Clients are located in VLAN 10 and VLAN 20 with corresponding IRB interfaces—IRB.10 and IRB.20. The IRB.10 and IRB.20 are part of the routing instance TENANT_CLIENT_VRF1.

    Configure the following in the DHCP Client VRF:

    • Configure the dhcp-relay forward-only routing-instance <name> option. This configuration specifies the routing instance where the DHCP Server is located. In this case, it is the "TENANT_SERVICE_VRF".

    • Configure the auto-export command to enable the routes from the DHCP Client VRF exported into the DHCP Server VRF.

DHCP Relay with a Single Loopback IP Address for the Entire Chassis

Step-by-Step Procedure

Do the steps that follow to configure DHCP Relay with a single loopback IP address for the entire chassis.

  1. Configure the loopback interfaces.

  2. Configure the routing instance where the DHCP Server is located.

  3. Configure the routing instances where the DHCP Clients are located.

DHCPv6 Relay

Step-by-Step Procedure

Do the steps below to configure the DHCP6 Relay.

  1. Configure the DHCPv6 Relay in the routing instance.

  2. Configure the IRB interfaces to send router advertisement messages with a default gateway address and the IPv6 prefix length information.

    The configuration enables the DHCPv6 Clients to identify the prefix length and the default gateway because the DHCPv6 Server does not provide the information.

Step-by-Step Procedure

Verification for DHCPv6 Relay

  1. Verify DHCPv6 Solicit Message

    Use the packet capture details of the DHCPv6 solicit message, see Figure 3.

    Figure 3: Packet Capture of the DHCPv6 Solicit MessagePacket Capture of the DHCPv6 Solicit Message

    In the packet capture file, you can see information of the DHCPv6 solicit message on the DHCPv6 Server. The output indicates that the source address of the DHCPv6 relay packet is the loopback IPv6 address of the VRF on the leaf device. The link address field indicates the prefix pool that needs to be selected by the DHCPv6 Server for address assignment.

  2. Verify DHCPv6 Reply Message Details

    Use the packet capture details of the DHCPv6 reply message, see Figure 4

    Figure 4: Packet Capture of the DHCPv6 Reply MessagePacket Capture of the DHCPv6 Reply Message

    In the packet capture file, you can see information of the DHCPv6 reply message sent by the DHCPv6 Server. The DHCPv6 reply is sent to the loopback address in the VRF on the leaf device. The fields indicate that the DHCPv6 Server is sending the assigned IP prefix for the endpoint and lifetime information. The reply message does not include prefix length and the default gateway address.

  3. Verify DHCPv6 Client Details

    Verify router advertisement messages on the DHCPv6 Client.

    Use the packet capture details of the DHCPv6 solicit message, see Figure 5

    Figure 5: Packet Capture of the DHCPv6 Solicit MessagePacket Capture of the DHCPv6 Solicit Message

    In the packet capture file, you can see information of the DHCPv6 Client. Here, you can see that the router advertisement message is providing the prefix length information along with the default gateway IP address as the link local IP address of the IRB interface.

Transit DHCP Relay

Validation

To confirm that the configuration is working properly, perform the following tasks:

Check DHCP Relay Statistics

Purpose

Verify that the DHCP relay is functioning.

Action

From operational mode:

Enable Tracing Options for DHCP

Purpose

Enable tracing options for the DHCP Relay agent.

Action

Use the following commands from edit mode:

DHCP Log Files

Purpose

View DHCP log files to get DHCP services details.

Action

From operational mode:

Meaning

The sample output shows the DHCP log messages in the messages file. The output command shown in the document is truncated for easy readability.